/** * Test getter/setter for label property */ public function testGetSetLabel() { // Change value and assert new $newCode = 'code'; $expectedCode = '[' . $newCode . ']'; $this->family->setCode($newCode); $this->assertEquals($expectedCode, $this->family->getLabel()); $newLabel = 'test-label'; $this->assertEntity($this->family->setLocale('en_US')); $this->assertEntity($this->family->setLabel($newLabel)); $this->assertEquals($newLabel, $this->family->getLabel()); // if no translation, assert the expected code is returned $this->family->setLocale('fr_FR'); $this->assertEquals($expectedCode, $this->family->getLabel()); // if empty translation, assert the expected code is returned $this->family->setLabel(''); $this->assertEquals($expectedCode, $this->family->getLabel()); }
/** * {@inheritDoc} */ public function getLabel() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getLabel', array()); return parent::getLabel(); }