public function testId() { $frameModel = new FrameModel(); $generatedId = $frameModel->getId(); $this->assertNotNull($generatedId); $this->assertEquals($frameModel->getId(), $generatedId); $this->assertSame($frameModel->setId("other-id"), $frameModel); $this->assertEquals($frameModel->getId(), "other-id"); }
/** * @see Renderable::render() */ public function render(\DOMDocument $domDocument) { $domElement = parent::render($domDocument); if ($this->model) { $this->model->checkId(); $domElement->setAttribute("modelid", $this->model->getId()); } else { if ($this->modelId) { $domElement->setAttribute("modelid", $this->modelId); } } return $domElement; }