コード例 #1
0
 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());
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 public function getFormat()
 {
     if (!$this->format instanceof FormatInterface) {
         $this->format = new StringFormat();
     }
     return parent::getFormat();
 }