/** * */ public function testCredits() { $expected = $this->getExpected(); $model = new Title(); $model->setAlign($expected['align']); $model->setFloating($expected['floating']); $model->setMargin($expected['margin']); $model->setStyle($expected['style']); $model->setText($expected['text']); $model->setUseHTML($expected['useHTML']); $model->setVerticalAlign($expected['verticalAlign']); $model->setX($expected['x']); $model->setY($expected['y']); $optionsProperty = $this->getPrivateProperty('options'); $this->assertEquals($expected, $optionsProperty->getValue($model)); unset($model); $model = new Title($expected); $this->assertEquals($expected['align'], $model->getAlign()); $this->assertEquals($expected['floating'], $model->isFloating()); $this->assertEquals($expected['margin'], $model->getMargin()); $this->assertEquals($expected['style'], $model->getStyle()); $this->assertEquals($expected['text'], $model->getText()); $this->assertEquals($expected['useHTML'], $model->isUseHTML()); $this->assertEquals($expected['verticalAlign'], $model->getVerticalAlign()); $this->assertEquals($expected['x'], $model->getX()); $this->assertEquals($expected['y'], $model->getY()); unset($model); $model = new Title(); $model->disable(); $this->assertEquals('', $model->getText()); }
public function testTitle() { $title = new Title(['text' => 'Monthly Average Temperature', 'x' => -20]); $this->assertEquals('{"text":"Monthly Average Temperature","x":-20}', $title->toJson()); $title = (new Title())->setText('Monthly Average Temperature')->setX(-20); $this->assertEquals('{"text":"Monthly Average Temperature","x":-20}', $title->toJson()); $title = new Title(); $title->text = 'Monthly Average Temperature'; $title->x = -20; $this->assertEquals('{"text":"Monthly Average Temperature","x":-20}', $title->toJson()); }