Ejemplo n.º 1
0
 public function testConvert()
 {
     $this->assertNotEmpty($this->obj->convert(new Hash()));
     $this->assertNotEmpty($this->obj->convert(new Hash(Hash::HASH_TYPE_SHA256, '', '', array('testBool'))));
     $this->assertNotEmpty($this->obj2->convert(new Hash()));
     $this->assertNotEmpty($this->obj2->convert(new Hash(Hash::HASH_TYPE_SHA256, '', '', array('testBool'))));
 }
Ejemplo n.º 2
0
 public function testCircularReferenceGraceful()
 {
     // setup a circular reference
     $this->obj->testEntityMarshal = $this->obj;
     $arr = $this->obj->convert(new PhpArray(true));
     $this->assertArrayHasKey('testEntityMarshal', $arr);
     $this->assertEquals(null, $arr['testEntityMarshal']);
 }
Ejemplo n.º 3
0
 protected function setUp()
 {
     $this->obj = new \MortadellaEntity();
     $this->obj->testEntityMarshal = new \MortadellaEntity();
     $this->obj->testTypedArray1 = array(new \MortadellaEntity(), new \MortadellaEntity(), new \MortadellaEntity(), new \stdClass());
     $stdObj = new \stdClass();
     $stdObj->prop1 = 'property 1';
     $stdObj->prop2 = 'property 2';
     $stdObj->propn = 'property n';
     $this->obj->setTestObject($stdObj);
 }
Ejemplo n.º 4
0
 public function testTypeof()
 {
     $this->assertEquals('', $this->obj2->typeof('testString'));
     $this->assertEquals('string', $this->obj->typeof('testString'));
     $this->assertEquals('', $this->obj->typeof('nonExistentProperty'));
 }
Ejemplo n.º 5
0
 public function testIgnoreKeys()
 {
     $result = $this->obj->convert(new QueryString(array('testEntityMarshal')));
     $this->assertNotEmpty($result);
     $this->assertNotContains('testEntityMarshal', $result);
 }
Ejemplo n.º 6
0
 public function testConvert()
 {
     $this->assertNotEmpty($this->obj->convert(new Json()));
 }