public function testCredits() { $credits = new Credits(); $credits->disable(); $this->assertEquals('{"enabled":false}', $credits->toJson()); $credits->setEnabled(true); $this->assertEquals('{"enabled":true}', $credits->toJson()); $credits->setText('Test Credits Test'); $this->assertEquals('{"enabled":true,"text":"Test Credits Test"}', $credits->toJson()); }
/** * */ public function testCredits() { $expected = $this->getExpected(); $model = new Credits(); $model->setEnabled($expected['enabled']); $model->setHref($expected['href']); $model->setPosition($expected['position']); $model->setStyle($expected['style']); $model->setText($expected['text']); $optionsProperty = $this->getPrivateProperty('options'); $this->assertEquals($expected, $optionsProperty->getValue($model)); unset($model); $model = new Credits($expected); $this->assertEquals($expected['enabled'], $model->isEnabled()); $this->assertEquals($expected['href'], $model->getHref()); $this->assertEquals($expected['position'], $model->getPosition()); $this->assertEquals($expected['style'], $model->getStyle()); $this->assertEquals($expected['text'], $model->getText()); unset($model); $model = new Credits(); $model->disable(); $this->assertEquals(false, $model->enabled); }