示例#1
0
 /**
  * This method tests the "singletons" methods.
  */
 public function test_singletons()
 {
     $p0 = IChar\Type::cr();
     $e0 = IChar\Type::cr();
     $this->assertInstanceOf('\\Saber\\Data\\IChar\\Type', $p0);
     $this->assertSame($e0->__hashCode(), $p0->__hashCode());
     $p1 = $p0->unbox();
     $e1 = "\r";
     $this->assertInternalType('string', $p1);
     $this->assertSame($e1, $p1);
     $p2 = IChar\Type::lf();
     $e2 = IChar\Type::lf();
     $this->assertInstanceOf('\\Saber\\Data\\IChar\\Type', $p2);
     $this->assertSame($e2->__hashCode(), $p2->__hashCode());
     $p3 = $p2->unbox();
     $e3 = "\n";
     $this->assertInternalType('string', $p3);
     $this->assertSame($e3, $p3);
     $p4 = IChar\Type::space();
     $e4 = IChar\Type::space();
     $this->assertInstanceOf('\\Saber\\Data\\IChar\\Type', $p4);
     $this->assertSame($e4->__hashCode(), $p4->__hashCode());
     $p5 = $p4->unbox();
     $e5 = ' ';
     $this->assertInternalType('string', $p5);
     $this->assertSame($e5, $p5);
 }