コード例 #1
0
ファイル: Optional.php プロジェクト: martinsv/bart
 /**
  * Returns an instance that contains no references
  * @return None
  */
 public static function absent()
 {
     return None::instance();
 }
コード例 #2
0
ファイル: NoneTest.php プロジェクト: martinsv/bart
 public function testEquals()
 {
     $absent = None::instance();
     $this->assertFalse($absent->equals(new Some('foo')));
     $this->assertTrue($absent->equals($absent));
 }
コード例 #3
0
ファイル: SomeTest.php プロジェクト: martinsv/bart
 public function testEquals()
 {
     $present = $this->getPresent();
     $this->assertTrue($present->equals(new Some($this->value)));
     $this->assertFalse($present->equals(new Some('some other value')));
     $this->assertFalse($present->equals(None::instance()));
 }