Esempio n. 1
0
 /**
  * Test a setter method with a namespaced type hint that
  * is within another namespace than the object itself.
  */
 public function testSetterNamespacedTypeHint()
 {
     $mapper = new JsonMapper();
     $json = '{"namespacedTypeHint":"Foo"}';
     $res = $mapper->map(json_decode($json), new UnitData());
     $this->assertInstanceOf('\\namespacetest\\UnitData', $res);
     $this->assertInstanceOf('\\othernamespace\\Foo', $res->internalData['namespacedTypeHint']);
     $this->assertEquals('Foo', $res->internalData['namespacedTypeHint']->name);
 }
Esempio n. 2
0
 public function testCaseInsensitivePropertyMatching()
 {
     $jm = new JsonMapper();
     $sn = $jm->map((object) array('PINT' => 2), new JsonMapperTest_Simple());
     $this->assertSame(2, $sn->pint);
 }