Example #1
0
 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);
 }
Example #2
0
 /**
  * @depends test_Max
  *
  * @expectedException LogicException
  * @expectedExceptionCode 340
  */
 public function test_Max_Exception()
 {
     Unify::createFull()->append(array(['name' => 'item1', 'value' => 'test1']))->max('value');
 }
Example #3
0
 /**
  * @expectedException InvalidArgumentException
  * @expectedExceptionCode 120
  */
 public function test_create2_exception()
 {
     Unify::create(new \stdClass());
 }
Example #4
0
 /**
  * @depends test_addXML_toXml_isXMLValid
  *
  * @expectedException InvalidArgumentException
  * @expectedExceptionCode 420
  */
 public function test_toXML_Exception()
 {
     Unify::createFull()->toXML('item', []);
 }
Example #5
0
 /**
  * @depends test_toJson
  *
  * @expectedException InvalidArgumentException
  * @expectedExceptionCode 520
  */
 public function test_toJson_Exception()
 {
     Unify::createFull()->toJson([]);
 }
Example #6
0
 /**
  * @depends test_Limit_Exception
  *
  * @expectedException InvalidArgumentException
  * @expectedExceptionCode 251
  */
 public function test_Limit_Exception2()
 {
     Unify::createFull()->limit(5, '');
 }
Example #7
0
 /**
  * @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'));
 }