public function testPropertyDefaultValueCanHandleUnquotedString() { $propDefaultValue = new PHP\PHPPropertyValue(); $propDefaultValue->setValue('PHP_EOL'); $propDefaultValue->setType('constant'); $this->assertEquals('PHP_EOL;', $propDefaultValue->generate()); $propDefaultValue = new PHP\PHPPropertyValue(); $propDefaultValue->setValue(5); $this->assertEquals('5;', $propDefaultValue->generate()); $propDefaultValue = new PHP\PHPPropertyValue(); $propDefaultValue->setValue(5.25); $this->assertEquals('5.25;', $propDefaultValue->generate()); }
/** * @dataProvider dataSetTypeSetValueGenerate * @param string $type * @param mixed $value * @param string $code */ public function testSetTypeSetValueGenerate($type, $value, $code) { $defaultValue = new PHP\PHPPropertyValue(); $defaultValue->setType($type); $defaultValue->setValue($value); $this->assertEquals($type, $defaultValue->getType()); $this->assertEquals($code, $defaultValue->generate()); }