Here is an example from a test set that includes database results. If you need to interact directly with the database in your test the entity manager can be made available to the test. For more information, see this bit of documentation. Note that results are more usually presented in a web page and read by the DOM crawler.
public function setUp()
{
self::bootKernel();
$this->em = static::$kernel->getContainer()
->get('doctrine')
->getManager()
;
$this->tool = static::$kernel->getContainer()
->get('truckee.toolbox')
;
$classes = array(
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadFocusSkillData',
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadMinimumData',
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadStaffUserGlenshire',
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadStaffUserMelanzane',
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadOpportunity',
'Truckee\VolunteerBundle\DataFixtures\SampleData\LoadVolunteer',
);
$this->loadFixtures($classes);
$this->client = $this->createClient();
$this->client->followRedirects();
}
public function testOutboxUser()
{
$crawler = $this->login('admin');
$link = $crawler->selectLink("Send alerts to organizations")->link();
$crawler = $this->client->click($link);
$outboxObj = $this->em->getRepository('TruckeeVolunteerBundle:AdminOutbox')->findAll();
$outbox = $outboxObj[0];
$recipient = $outbox->getRecipientId();
$type = $this->tool->getTypeFromId($recipient);
$this->assertEquals('staff', $type);
}