|
17 | 17 | use Mockery\Adapter\Phpunit\MockeryTestCase;
|
18 | 18 | use phpDocumentor\Reflection\Exception;
|
19 | 19 | use phpDocumentor\Reflection\Fqsen;
|
20 |
| -use phpDocumentor\Reflection\Php\Factory\DummyFactoryStrategy; |
21 | 20 | use function array_keys;
|
22 | 21 | use function count;
|
23 | 22 | use function current;
|
|
43 | 42 | final class ProjectFactoryTest extends MockeryTestCase
|
44 | 43 | {
|
45 | 44 | /**
|
46 |
| - * @covers ::__construct |
| 45 | + * Tests whether a factory can be instantiated using recommended factories. |
| 46 | + * |
| 47 | + * This test is unable to test which exact factories are instantiated because that is not exposed by |
| 48 | + * the factory. Even using assertEquals to do a regression test against a pre-populated factory does not |
| 49 | + * work because there is a piece of randomness inside one of the properties; causing the tests to fail when |
| 50 | + * you try to do it like that. |
| 51 | + * |
| 52 | + * @uses \phpDocumentor\Reflection\Middleware\ChainFactory |
| 53 | + * @uses \phpDocumentor\Reflection\Php\Factory\Property |
| 54 | + * @uses \phpDocumentor\Reflection\Php\Factory\Argument |
| 55 | + * @uses \phpDocumentor\Reflection\Php\Factory\Method |
| 56 | + * @uses \phpDocumentor\Reflection\Php\Factory\Class_ |
| 57 | + * @uses \phpDocumentor\Reflection\Php\Factory\Interface_ |
| 58 | + * @uses \phpDocumentor\Reflection\Php\Factory\ClassConstant |
| 59 | + * @uses \phpDocumentor\Reflection\Php\Factory\Define |
| 60 | + * @uses \phpDocumentor\Reflection\Php\Factory\GlobalConstant |
| 61 | + * @uses \phpDocumentor\Reflection\Php\Factory\Argument |
| 62 | + * @uses \phpDocumentor\Reflection\Php\Factory\Trait_ |
| 63 | + * @uses \phpDocumentor\Reflection\Php\Factory\DocBlock |
| 64 | + * @uses \phpDocumentor\Reflection\Php\Factory\File |
| 65 | + * @uses \phpDocumentor\Reflection\Php\NodesFactory |
| 66 | + * |
| 67 | + * @covers ::createInstance |
47 | 68 | */
|
48 |
| - public function testStrategiesAreChecked() : void |
| 69 | + public function testCreatingAnInstanceInstantiatesItWithTheRecommendedStrategies() |
49 | 70 | {
|
50 |
| - new ProjectFactory([new DummyFactoryStrategy()]); |
51 |
| - $this->assertTrue(true); |
| 71 | + $this->assertInstanceOf(ProjectFactory::class, ProjectFactory::createInstance()); |
52 | 72 | }
|
53 | 73 |
|
54 | 74 | /**
|
|
0 commit comments