@@ -51,12 +51,12 @@ Now, enable it as a PHPUnit extension (PHPUnit 8 or higher) or a listener
51
51
52
52
<!-- Add this in PHPUnit 8 or higher -->
53
53
<extensions >
54
- <extension class =" DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
54
+ <extension class =" DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
55
55
</extensions >
56
56
57
57
<!-- Add this in PHPUnit 7 or lower -->
58
58
<listeners >
59
- <listener class =" \DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" />
59
+ <listener class =" \DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" />
60
60
</listeners >
61
61
</phpunit >
62
62
@@ -100,7 +100,7 @@ Customize the new class to load ``Product`` objects into Doctrine::
100
100
public function load(ObjectManager $manager)
101
101
{
102
102
$product = new Product();
103
- $product->setName('Priceless widget! ');
103
+ $product->setName('Priceless widget');
104
104
$product->setPrice(14.50);
105
105
$product->setDescription('Ok, I guess it *does* have a price');
106
106
$manager->persist($product);
@@ -230,14 +230,14 @@ so, get the entity manager via the service container as follows::
230
230
->getManager();
231
231
}
232
232
233
- public function testSearchByCategoryName ()
233
+ public function testSearchByName ()
234
234
{
235
- $products = $this->entityManager
235
+ $product = $this->entityManager
236
236
->getRepository(Product::class)
237
- ->searchByCategoryName('foo' )
237
+ ->findOneBy(['name' => 'Priceless widget'] )
238
238
;
239
239
240
- $this->assertCount(1 , $products );
240
+ $this->assertSame(14.50 , $product->getPrice() );
241
241
}
242
242
243
243
protected function tearDown()
@@ -250,6 +250,5 @@ so, get the entity manager via the service container as follows::
250
250
}
251
251
}
252
252
253
- .. _`DoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
254
253
.. _`DAMADoctrineTestBundle` : https://github.com/dmaicher/doctrine-test-bundle
255
254
.. _`DoctrineFixturesBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
0 commit comments