Skip to content

Commit 932bedf

Browse files
authored
Merge pull request #20 from boldare/feat/upgrade-of-tests-and-depencies
Upgrade of tests and dependencies.
2 parents 876feb2 + 63473bf commit 932bedf

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Tests/Unit/DependencyInjection/CompilerPass/ModelFactoryCollectionCompilerPassTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace Xsolve\ModelFactoryBundle\Tests\Unit\DependencyInjection\CompilerPass;
44

5-
use PHPUnit_Framework_TestCase;
5+
use PHPUnit\Framework\TestCase;
66
use Prophecy\Argument;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
88
use Symfony\Component\DependencyInjection\Definition;
99
use Symfony\Component\DependencyInjection\Reference;
1010
use Xsolve\ModelFactoryBundle\DependencyInjection\CompilerPass\ModelFactoryCollectionCompilerPass;
1111

12-
class ModelFactoryCollectionCompilerPassTest extends PHPUnit_Framework_TestCase
12+
class ModelFactoryCollectionCompilerPassTest extends TestCase
1313
{
1414
/**
1515
* @test
@@ -38,9 +38,10 @@ public function will_inject_factories_into_collections()
3838
count($args) === 1
3939
&& $args[0] instanceof Reference
4040
&& (string) $args[0] === 'model_factory.foo'
41-
;
41+
;
4242
})
4343
)
44+
->willReturn($modelFactoryCollectionDefinitionFirst->reveal())
4445
->shouldBeCalledTimes(1);
4546
$modelFactoryCollectionDefinitionFirst
4647
->addMethodCall(
@@ -50,9 +51,10 @@ public function will_inject_factories_into_collections()
5051
count($args) === 1
5152
&& $args[0] instanceof Reference
5253
&& (string) $args[0] === 'model_factory.bar'
53-
;
54+
;
5455
})
5556
)
57+
->willReturn($modelFactoryCollectionDefinitionFirst->reveal())
5658
->shouldBeCalledTimes(1);
5759
$modelFactoryCollectionDefinitionFirst = $modelFactoryCollectionDefinitionFirst->reveal();
5860

@@ -65,9 +67,10 @@ public function will_inject_factories_into_collections()
6567
count($args) === 1
6668
&& $args[0] instanceof Reference
6769
&& (string) $args[0] === 'model_factory.bar'
68-
;
70+
;
6971
})
7072
)
73+
->willReturn($modelFactoryCollectionDefinitionSecond->reveal())
7174
->shouldBeCalledTimes(1);
7275
$modelFactoryCollectionDefinitionSecond
7376
->addMethodCall(
@@ -77,9 +80,10 @@ public function will_inject_factories_into_collections()
7780
count($args) === 1
7881
&& $args[0] instanceof Reference
7982
&& (string) $args[0] === 'model_factory.baz'
80-
;
83+
;
8184
})
8285
)
86+
->willReturn($modelFactoryCollectionDefinitionSecond->reveal())
8387
->shouldBeCalledTimes(1);
8488
$modelFactoryCollectionDefinitionSecond = $modelFactoryCollectionDefinitionSecond->reveal();
8589

Tests/Unit/XsolveModelFactoryBundleTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22

33
namespace Xsolve\ModelFactoryBundle\Tests\Unit;
44

5-
use PHPUnit_Framework_TestCase;
5+
use PHPUnit\Framework\TestCase;
66
use Prophecy\Argument;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
88
use Xsolve\ModelFactoryBundle\DependencyInjection\CompilerPass\ModelFactoryCollectionCompilerPass;
99
use Xsolve\ModelFactoryBundle\XsolveModelFactoryBundle;
1010

11-
class XsolveModelFactoryBundleTest extends PHPUnit_Framework_TestCase
11+
class XsolveModelFactoryBundleTest extends TestCase
1212
{
1313
public function test_build()
1414
{
1515
$container = $this->prophesize(ContainerBuilder::class);
1616
$container
1717
->addCompilerPass(Argument::type(ModelFactoryCollectionCompilerPass::class))
18+
->willReturn($container->reveal())
1819
->shouldBeCalledTimes(1);
1920

2021
$bundle = new XsolveModelFactoryBundle();
2122

2223
$bundle->build($container->reveal());
2324
}
24-
}
25+
}

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
],
1616
"require": {
1717
"php": "^5.6|^7.0|^8.0",
18-
"symfony/framework-bundle": "^2.3|^3.0|^4.0|^5.0",
18+
"symfony/framework-bundle": "^2.3|^3.0|^4.0|^5.0|^6.0",
1919
"xsolve-pl/model-factory": "^1.0"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^5.5",
22+
"phpunit/phpunit": "^5.5|^6.0|^7.0|^8.0|^9.0",
2323
"symfony/phpunit-bridge": "^3.0|^4.0|^5.0",
2424
"sebastian/phpcpd": "^2.0",
25-
"phpmd/phpmd": "^2.4"
25+
"phpmd/phpmd": "^2.4",
26+
"phpspec/prophecy": "^1.16"
2627
},
2728
"autoload":{
2829
"psr-4":{

0 commit comments

Comments
 (0)