示例#1
0
 /**
  * This method tests the "nvl" method.
  */
 public function test_nvl()
 {
     $x = IArrayList\Type::make(array(1, 2, 3), '\\Saber\\Data\\IInt32\\Type');
     $y = IArrayList\Type::empty_();
     $z = IArrayList\Module::nvl($x, $y);
     $this->assertInstanceOf('\\Saber\\Data\\IArrayList\\Type', $z);
     $this->assertSame(array(1, 2, 3), $z->unbox(1));
     $z = IArrayList\Module::nvl(null, $x);
     $this->assertInstanceOf('\\Saber\\Data\\IArrayList\\Type', $z);
     $this->assertSame(array(1, 2, 3), $z->unbox(1));
     $z = IArrayList\Module::nvl(null, null);
     $this->assertInstanceOf('\\Saber\\Data\\IArrayList\\Type', $z);
     $this->assertSame(array(), $z->unbox(1));
 }