public function testCreate() { $format = $this->getMockForAbstractClass('PositionalFile\\Format\\AbstractFormat'); $this->object->setFormat($format); $type = clone $this->object; $type::staticExpects($this->any())->method('create')->will($this->returnValue($this->object)); $this->assertInstanceOf('PositionalFile\\Type\\TypeInterface', $type); $this->assertInstanceOf('PositionalFile\\Format\\FormatInterface', $type->getFormat()); }
/** * @inheritdoc */ public function getFormat() { if (!$this->format instanceof FormatInterface) { $this->format = new StringFormat(); } return parent::getFormat(); }