Skip to content
Permalink
Browse files

Merge pull request #76 from ergebnis/fix/fixture

Fix: Remove fixture used once only
  • Loading branch information
localheinz committed Mar 23, 2020
2 parents 75c4844 + 7a45cbe commit ac6cadc1b2439bbaa32ac6ec60ffc061c84fde09
@@ -165,11 +165,6 @@ parameters:
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:getId\\(\\) has a nullable return type declaration\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:\\$crew with generic class Doctrine\\\\Common\\\\Collections\\\\ArrayCollection does not specify its types\\: TKey, T$#"
count: 1
@@ -149,11 +149,6 @@
<code>$id</code>
</PropertyNotSetInConstructor>
</file>
<file src="test/Fixture/FixtureFactory/Entity/SpaceStation.php">
<PropertyNotSetInConstructor occurrences="1">
<code>$id</code>
</PropertyNotSetInConstructor>
</file>
<file src="test/Fixture/FixtureFactory/Entity/Spaceship.php">
<InvalidTemplateParam occurrences="2">
<code>ArrayCollection&lt;Person&gt;</code>

This file was deleted.

@@ -31,6 +31,16 @@ class Spaceship
*/
protected $id;

/**
* @ORM\Column(
* name="type",
* nullable=false
* )
*
* @var string
*/
protected $type = 'cruiser';

/**
* @ORM\Column(
* name="name",
@@ -68,6 +78,16 @@ public function getId(): ?int
return $this->id;
}

public function getType(): string
{
return $this->type;
}

public function setType(string $type): void
{
$this->type = $type;
}

public function getName(): ?string
{
return $this->name;
@@ -207,12 +207,12 @@ public function testPreservesDefaultValuesOfEntity(): void
{
$fixtureFactory = new FixtureFactory(self::createEntityManager());

$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\SpaceStation::class);
$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\Spaceship::class);

/** @var Fixture\FixtureFactory\Entity\Spaceship $spaceship */
$spaceship = $fixtureFactory->get(Fixture\FixtureFactory\Entity\SpaceStation::class);
$spaceship = $fixtureFactory->get(Fixture\FixtureFactory\Entity\Spaceship::class);

self::assertSame('Babylon5', $spaceship->getName());
self::assertSame('cruiser', $spaceship->getType());
}

public function testDoesNotCallTheConstructorOfTheEntity(): void

0 comments on commit ac6cadc

Please sign in to comment.
You can’t perform that action at this time.