コード例 #1
0
 public function testTwig()
 {
     $object = new AccessorHelper();
     $object->setName('test');
     $loader = new \Twig_Loader_Filesystem(__DIR__ . '/Resources/views');
     $twig = new \Twig_Environment($loader);
     $rendered = $twig->loadTemplate('test.html.twig')->render(array('object' => $object));
     $this->assertEquals('test', trim($rendered));
 }
コード例 #2
0
    public function testAccessorHelper()
    {
        $object = new AccessorHelper();
        $this->assertEquals('* @method int getId()
* @method string getName()
* @method bool isName()
* @method $this setName(string $name)
* @method $this addValue(string $value)
* @method string getValue()
* @method bool isValue()
* @method $this removeValue(string $value)
', $object->_generatePhpDoc());
    }
コード例 #3
0
 public function testCall()
 {
     $object = new AccessorHelper();
     $object->setName('test');
     $object->addValue('test');
     $this->assertEquals('test', $object->getName());
     $this->assertTrue($object->isName());
     $this->assertEquals('test', $object->getValue()[0]);
     $this->assertTrue($object->isValue());
     $object->removeValue('test');
     $this->assertCount(0, $object->getValue());
     $this->assertFalse($object->isValue());
 }