public function doesMatch_should_work_with_generic_AnyMatcher()
 {
     $this->sut->setArguments(array(Arg::any()));
     $this->assertTrue($this->sut->doesMatchArgs(array(NULL)));
     $this->assertTrue($this->sut->doesMatchArgs(array('test')));
     $this->assertTrue($this->sut->doesMatchArgs(array(42)));
     $this->assertTrue($this->sut->doesMatchArgs(array(new Object())));
 }
示例#2
0
 static function __static()
 {
     self::$any = new AnyMatcher();
 }
 public function arg_any_accepts_all_arguments()
 {
     $object = $this->fixture->createMock('net.xp_framework.unittest.tests.mock.IComplexInterface');
     $expect = 'c1';
     $object->bar(Arg::any(), Arg::any())->returns($expect)->repeatAny();
     $this->fixture->replayAll();
     $this->assertEquals($expect, $object->bar(NULL, NULL));
     $this->assertEquals($expect, $object->bar(34, 'foo'));
     $this->assertEquals($expect, $object->bar(23.0, new Object()));
 }
 public function any_should_match_null()
 {
     $this->assertTrue(Arg::any()->matches(NULL));
 }