/** * @covers ::unserializeProperty * @dataProvider dataSerialize */ public function testUnserialze($expected, $value) { $serializer = new NullSerializer('test'); $subject = ['test' => $value]; $this->assertEquals($expected, $serializer->unserializeProperty($subject)); $subject = new stdClass(); $subject->test = $value; $this->assertEquals($expected, $serializer->unserializeProperty($subject)); }
/** * @covers ::setProperty * @dataProvider dataSetProperty */ public function testSetProperty($subject, $name, $val, $expected, $expectedException) { $item = new NullSerializer($name); if ($expectedException) { $this->setExpectedException('InvalidArgumentException', $expectedException); } $item->setProperty($subject, $val); $this->assertEquals($expected, $subject); }