public function testMatch() { $this->assertTrue(Matchers::isArray()->match(array(1, 2, 3))); }
public function testArgsMatcher() { $builder = new MockBuilder(); $builder->abc(Matchers::isString())->andReturn(1); $builder->abc(Matchers::isString(), 2, Matchers::isInt())->andReturn(2); $mock = $builder->getMock(); $this->assertEquals(1, $mock->abc('lorem ipsum')); $this->assertEquals(2, $mock->abc('dolor', 2, 1)); }
public function matchProvider() { return array(array(Matchers::isBool(), FALSE), array(Matchers::isNumeric(), '123'), array(Matchers::isInt(), 1), array(Matchers::isFloat(), 1.0), array(Matchers::isArray(), array(1, 2, 3)), array(Matchers::isString(), 'lorem'), array(Matchers::regexp('/lorem/'), 'lorem ipsum')); }
public function notMatchProvider() { $object = new Circular(); $object2 = new Circular(); return array(array(array(), array(1)), array(array(Matchers::isInt()), array('lorem')), array(array($object, Matchers::isString()), array($object2, 'lorem'))); }