Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #140 from ergebnis/fix/faker
Browse files Browse the repository at this point in the history
Fix: Use real faker in test
  • Loading branch information
localheinz committed Mar 17, 2020
2 parents 23e57bc + 0356f22 commit 4c7af97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Unit/DefinitionsTest.php
Expand Up @@ -91,14 +91,14 @@ public function testFluentInterface(): void
$definitions = Definitions::in(__DIR__ . '/../Fixture/Definition/Acceptable');

self::assertSame($definitions, $definitions->registerWith($this->prophesize(FixtureFactory::class)->reveal()));
self::assertSame($definitions, $definitions->provideWith($this->prophesize(Generator::class)->reveal()));
self::assertSame($definitions, $definitions->provideWith(new Generator()));
}

public function testInAcceptsClassesWhichAreAcceptableAndFakerAwareAndProvidesThemWithFaker(): void
{
$faker = $this->prophesize(Generator::class);
$faker = new Generator();

$definitions = Definitions::in(__DIR__ . '/../Fixture/Definition/FakerAware')->provideWith($faker->reveal());
$definitions = Definitions::in(__DIR__ . '/../Fixture/Definition/FakerAware')->provideWith($faker);

$reflection = new \ReflectionClass(Definitions::class);

Expand All @@ -120,7 +120,7 @@ public function testInAcceptsClassesWhichAreAcceptableAndFakerAwareAndProvidesTh
$fakerAwareDefinition = \array_shift($fakerAwareDefinitions);

self::assertInstanceOf(Fixture\Definition\FakerAware\GroupDefinition::class, $fakerAwareDefinition);
self::assertSame($faker->reveal(), $fakerAwareDefinition->faker());
self::assertSame($faker, $fakerAwareDefinition->faker());
}

public function testThrowsInvalidDefinitionExceptionIfInstantiatingDefinitionsThrowsException(): void
Expand Down

0 comments on commit 4c7af97

Please sign in to comment.