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')))); }
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']); }
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); }
public function testTypeof() { $this->assertEquals('', $this->obj2->typeof('testString')); $this->assertEquals('string', $this->obj->typeof('testString')); $this->assertEquals('', $this->obj->typeof('nonExistentProperty')); }
public function testIgnoreKeys() { $result = $this->obj->convert(new QueryString(array('testEntityMarshal'))); $this->assertNotEmpty($result); $this->assertNotContains('testEntityMarshal', $result); }
public function testConvert() { $this->assertNotEmpty($this->obj->convert(new Json())); }