public function testExtract() { $abstractObject = $this->getMockForAbstractClass('\\Matryoshka\\Model\\Object\\AbstractObject'); $strategy = new HasOneStrategy($abstractObject); $strategy->setNullable(false); $this->assertInternalType('array', $strategy->extract($abstractObject)); $this->assertInternalType('array', $strategy->extract([])); $this->assertInternalType('array', $strategy->extract(null)); $strategy->setNullable(true); $this->assertNull($strategy->extract(null)); $this->setExpectedException('\\Matryoshka\\Model\\Exception\\InvalidArgumentException'); $strategy->extract('wrong value'); }