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)); }
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()); }
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()); }