Skip to content

Commit 36f2ca4

Browse files
brikouweaverryan
authored andcommitted
made use of static:: instead of (and inherit from parent's tearDown method)
1 parent 539b361 commit 36f2ca4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cookbook/testing/doctrine.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,18 @@ which makes all of this quite easy::
3434

3535
public function setUp()
3636
{
37-
$kernel = static::createKernel();
38-
$kernel->boot();
39-
$this->em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
37+
static::$kernel = static::createKernel();
38+
static::$kernel->boot();
39+
$this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
4040
}
4141

42-
public function testProductByCategoryName()
42+
public function testSearchByCategoryName()
4343
{
44-
$results = $this->em
44+
$products = $this->em
4545
->getRepository('AcmeStoreBundle:Product')
46-
->searchProductsByNameQuery('foo')
47-
->getResult()
46+
->searchByCategoryName('foo')
4847
;
4948

50-
$this->assertCount(1, $results);
49+
$this->assertCount(1, $products);
5150
}
5251
}

0 commit comments

Comments
 (0)