public function test_create_toYaml_addYaml() { $c1 = Unify::Create(['yaml'])->offsetSet('name', 'value'); $xamlString = $c1->toYaml(); $c2 = Unify::Create(['yaml']); $c2->addYaml($xamlString); $this->assertEquals(true, is_string($xamlString)); $this->assertEquals(true, $c2->offsetExists('name')); $this->assertEquals('value', $c2->name); }
/** * @depends test_Max * * @expectedException LogicException * @expectedExceptionCode 340 */ public function test_Max_Exception() { Unify::createFull()->append(array(['name' => 'item1', 'value' => 'test1']))->max('value'); }
/** * @expectedException InvalidArgumentException * @expectedExceptionCode 120 */ public function test_create2_exception() { Unify::create(new \stdClass()); }
/** * @depends test_addXML_toXml_isXMLValid * * @expectedException InvalidArgumentException * @expectedExceptionCode 420 */ public function test_toXML_Exception() { Unify::createFull()->toXML('item', []); }
/** * @depends test_toJson * * @expectedException InvalidArgumentException * @expectedExceptionCode 520 */ public function test_toJson_Exception() { Unify::createFull()->toJson([]); }
/** * @depends test_Limit_Exception * * @expectedException InvalidArgumentException * @expectedExceptionCode 251 */ public function test_Limit_Exception2() { Unify::createFull()->limit(5, ''); }
/** * @depends test_createWith */ public function test_create_string() { $c = Unify::create('operation'); $this->assertEquals(true, $c instanceof Collection); $this->assertEquals(true, $c->extensions()->exists('renameAll')); $this->assertEquals(false, $c->extensions()->exists('avg')); $this->assertEquals(false, $c->extensions()->exists('toHTML')); }