Example #1
0
 public function testDump()
 {
     $builder = new Builder();
     $dumper = new ProjectDumper($builder);
     try {
         $dumper->dump();
         $this->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
     } catch (\LogicException $e) {
     }
 }
Example #2
0
 public function testDump()
 {
     $builder = new ContainerBuilder();
     $dumper = new ProjectDumper($builder);
     try {
         $dumper->dump();
         $this->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\LogicException', $e, '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
         $this->assertEquals('You must extend this abstract class and implement the dump() method.', $e->getMessage(), '->dump() returns a LogicException if the dump() method has not been overriden by a children class');
     }
 }
<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once __DIR__ . '/../../bootstrap/unit.php';
$t = new lime_test(1);
class ProjectDumper extends sfServiceContainerDumper
{
}
$builder = new sfServiceContainerBuilder();
$dumper = new ProjectDumper($builder);
try {
    $dumper->dump();
    $t->fail('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
} catch (LogicException $e) {
    $t->pass('->dump() returns a LogicException if the dump() method has not been overriden by a children class');
}