Example #1
0
 /**
  * @group pages
  */
 public function testGetMenu()
 {
     $this->srv = $this->getContainer()->get('pages');
     $actual = $this->srv->getMenu();
     $expected = \Application\MainBundle\DataFixtures\ORM\LoadPagesData::$menu;
     $this->assertTrue(is_array($actual));
     $this->assertEquals($expected, $actual);
 }
Example #2
0
 /**
  * @group sender
  */
 public function testSend()
 {
     $command = sprintf('%s %s %s', PHP_BINARY, $this->getContainer()->get('kernel')->getRootDir() . '/../bin/console', '--no-ansi swiftmailer:spool:send --env=test');
     $result = trim(`{$command}`);
     $this->assertRegExp('/ 0 emails sent$/', $result);
     $to = ['name' => 'Jacek Siciarek', 'email' => '*****@*****.**'];
     $params = ['user' => 'Czesław Olak', 'date' => new \DateTime('1966-10-21 15:10:00')];
     $template = '::email/test.html.twig';
     $message = $this->srv->getMessage($template, $params, $to);
     $this->assertTrue($this->srv->send($message));
     $result = trim(`{$command}`);
     $this->assertRegExp('/ 1 emails sent$/', $result);
 }