Ejemplo n.º 1
0
 public function testArrayWithObjectThrowsExceptionWithNonRTObject()
 {
     try {
         $obj = new stdClass();
         $array = RTArray::arrayWithObject($obj);
     } catch (InvalidArgumentException $e) {
         return;
     }
     $this->fail("RTArray::arrayWithObject should throw an exception when given an object " . "that doesn't inherit from RTObject");
 }
Ejemplo n.º 2
0
 public function testInitWithPHPArray()
 {
     $array = array("one" => "42", "two" => 42, "three" => YES, "four" => RTArray::arrayWithObjects("42", 42, YES, NO));
     $dict = RTDictionary::alloc()->initWithPHPArray($array);
     $this->assertEquals(4, $dict->count());
     $rtArray = RTArray::arrayWithObject($array);
     $dict = RTDictionary::alloc()->initWithPHPArray($rtArray);
     $this->assertEquals(1, $dict->count());
 }