Skip to content

Instantly share code, notes, and snippets.

@mikeemoo
Created May 29, 2012 14:56
Show Gist options
  • Select an option

  • Save mikeemoo/2828892 to your computer and use it in GitHub Desktop.

Select an option

Save mikeemoo/2828892 to your computer and use it in GitHub Desktop.
ExampleInheritanceFunctionalTest
<?php
namespace Lowpress\ExampleBundle\Tests\Entity;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ExampleInheritanceFunctionalTest extends WebTestCase
{
/**
* @var \Doctrine\ORM\EntityManager
*/
private $em;
public function setUp()
{
$kernel = static::createKernel();
$kernel->boot();
$this->em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
}
public function testSelectContentPage()
{
$repos = $this->em->getRepository('LowpressExampleBundle:ContentPage');
$results = $repos->findAll();
$this->assertCount(1, $results);
$repos = $this->em->getRepository('LowpressCmsBundle:HtmlPage');
$results = $repos->findAll();
$this->assertGreaterThanOrEqual(2, count($results));
foreach ($results as $result){
$this->assertTrue(is_a($result, "Lowpress\CmsBundle\Entity\HtmlPage"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment