Lines Matching refs:mock

15         $mock = $this->getMockBuilder(AnInterface::class)
18 $mock->expects($this->never())
24 $mock = $this->getMockBuilder(SomeClass::class)
27 $mock->expects($this->never())
37 $mock = $this->getMockBuilder(SomeClass::class)
40 $mock->expects($this->any())
50 $mock = $this->getMockBuilder(SomeClass::class)
53 $mock->method('doSomethingElse')
59 $mock = $this->getMockBuilder(AnInterface::class)
62 $mock->expects($this->atLeastOnce())
65 $mock->doSomething();
70 $mock = $this->getMockBuilder(AnInterface::class)
73 $mock->expects($this->atLeastOnce())
76 $mock->doSomething();
77 $mock->doSomething();
82 $mock = $this->getMockBuilder(AnInterface::class)
85 $mock->expects($this->atLeast(2))
88 $mock->doSomething();
89 $mock->doSomething();
94 $mock = $this->getMockBuilder(AnInterface::class)
97 $mock->expects($this->atLeast(2))
100 $mock->doSomething();
101 $mock->doSomething();
102 $mock->doSomething();
107 $mock = $this->getMockBuilder(AnInterface::class)
110 $mock->expects($this->atMost(2))
113 $mock->doSomething();
114 $mock->doSomething();
119 $mock = $this->getMockBuilder(AnInterface::class)
122 $mock->expects($this->atMost(2))
125 $mock->doSomething();
130 $mock = $this->getMockBuilder(AnInterface::class)
133 $mock->expects($this->once())
136 $mock->doSomething();
141 $mock = $this->getMockBuilder(SomeClass::class)
144 $mock->expects($this->once())
148 $mock->doSomethingElse('something');
153 $mock = $this->getMockBuilder(AnInterface::class)
156 $mock->expects($this->exactly(2))
159 $mock->doSomething();
160 $mock->doSomething();
165 $mock = $this->getMockBuilder(AnInterface::class)
168 $mock->expects($this->any())
174 $mock->doSomething();
179 $mock = $this->getMockBuilder(AnInterface::class)
182 $mock->expects($this->any())
188 $mock->doSomething();
193 $mock = $this->getMockBuilder(AnInterface::class)
196 $mock->expects($this->any())
200 $this->assertEquals('something', $mock->doSomething());
202 $mock = $this->getMockBuilder(AnInterface::class)
205 $mock->expects($this->any())
209 $this->assertEquals('something', $mock->doSomething());
219 $mock = $this->getMockBuilder(AnInterface::class)
222 $mock->expects($this->any())
226 $this->assertEquals('d', $mock->doSomething('a', 'b', 'c'));
227 $this->assertEquals('h', $mock->doSomething('e', 'f', 'g'));
228 $this->assertEquals(null, $mock->doSomething('foo', 'bar'));
230 $mock = $this->getMockBuilder(AnInterface::class)
233 $mock->expects($this->any())
237 $this->assertEquals('d', $mock->doSomething('a', 'b', 'c'));
238 $this->assertEquals('h', $mock->doSomething('e', 'f', 'g'));
239 $this->assertEquals(null, $mock->doSomething('foo', 'bar'));
244 $mock = $this->getMockBuilder(AnInterface::class)
247 $mock->expects($this->any())
251 $this->assertEquals('b', $mock->doSomething('a', 'b'));
253 $mock = $this->getMockBuilder(AnInterface::class)
256 $mock->expects($this->any())
260 $this->assertEquals('b', $mock->doSomething('a', 'b'));
265 $mock = $this->getMockBuilder(SomeClass::class)
269 $mock->expects($this->once())
273 $this->assertEquals('pass', $mock->doSomething('foo', 'bar'));
275 $mock = $this->getMockBuilder(SomeClass::class)
279 $mock->expects($this->once())
283 $this->assertEquals('pass', $mock->doSomething('foo', 'bar'));
288 $mock = $this->getMockBuilder(AnInterface::class)
291 $mock->expects($this->any())
295 $this->assertEquals($mock, $mock->doSomething());
297 $mock = $this->getMockBuilder(AnInterface::class)
300 $mock->expects($this->any())
304 $this->assertEquals($mock, $mock->doSomething());
309 $mock = $this->getMockBuilder(AnInterface::class)
312 $mock->expects($this->any())
316 $this->assertEquals('a', $mock->doSomething());
317 $this->assertEquals('b', $mock->doSomething());
318 $this->assertEquals('c', $mock->doSomething());
320 $mock = $this->getMockBuilder(AnInterface::class)
323 $mock->expects($this->any())
327 $this->assertEquals('a', $mock->doSomething());
328 $this->assertEquals('b', $mock->doSomething());
329 $this->assertEquals('c', $mock->doSomething());
334 $mock = $this->getMockBuilder(SomeClass::class)
338 $mock->expects($this->once())
342 $this->assertEquals('pass', $mock->doSomething('foo', 'bar'));
347 $mock = $this->getMockBuilder(SomeClass::class)
351 $mock->expects($this->once())
355 $this->assertEquals('pass', $mock->doSomething('foo', 'bar'));
434 $mock = $this->getMockBuilder(stdClass::class)->setMockClassName('FixedName')->getMock();
435 $mock = $this->getMockBuilder(stdClass::class)->setMockClassName('FixedName')->getMock();
436 $this->assertInstanceOf(stdClass::class, $mock);
466 $mock = $this->getMockBuilder(AbstractMockTestClass::class)
469 $mock->expects($this->never())
478 $mock = $this->getMockBuilder($type)
481 $this->assertInstanceOf(Traversable::class, $mock);
486 $mock = $this->getMockBuilder([AnInterface::class, AnotherInterface::class])
489 $this->assertInstanceOf(AnInterface::class, $mock);
490 $this->assertInstanceOf(AnotherInterface::class, $mock);
495 $mock = $this->getMockForTrait(AbstractTrait::class);
497 $mock->expects($this->never())
500 $parent = get_parent_class($mock);
545 $mock = $this->getMockBuilder(stdClass::class)
549 $mock->expects($this->once())
553 $mock->foo($y);
563 $mock = $this->getMockBuilder(stdClass::class)
567 $mock->expects($this->once())
571 $mock->foo($y);
578 $mock = $this->getMockBuilder('SomeClass')
585 $mock->expects($this->any())
595 $mock->doSomethingElse($expectedObject);
606 $mock = $this->getMockBuilder('SomeClass')
613 $mock->expects($this->any())
623 $mock->doSomethingElse($expectedObject);
646 $mock = $this->getMockBuilder(SomeClass::class)
650 $mock->expects($this->once())
653 $mock->wrong();
656 $mock->__phpunit_verify();
671 $mock = $this->getMockBuilder(SomeClass::class)
675 $mock->expects($this->once())
678 $mock->wrong();
681 $mock->__phpunit_verify();
696 $mock = $this->getMockBuilder(SomeClass::class)
700 $mock->expects($this->once())
705 $mock->right(['second']);
716 $mock->__phpunit_verify();
740 $mock = $this->getMockBuilder(SomeClass::class)
744 $mock->expects($this->never())
749 $mock->right();
763 $mock = $this->getMockBuilder(SomeClass::class)
767 $mock->expects($this->never())
772 $mock->right();
786 $mock = $this->getMockBuilder(SomeClass::class)
790 $mock->expects($this->once())
795 $mock->right();
905 $mock = $this->getMockFromWsdl(__DIR__ . '/_fixture/GoogleSearch.wsdl', 'WsdlMock');
909 get_class($mock)
918 … $mock = $this->getMockFromWsdl(__DIR__ . '/_fixture/GoogleSearch.wsdl', 'My\\Space\\WsdlMock');
922 get_class($mock)
955 $mock = $this->getMockBuilder(ClassWithStaticMethod::class)->getMock();
957 $mock->staticMethod();
993 $mock = $this->getMockBuilder(StringableClass::class)->getMock();
995 $this->assertInternalType('string', (string) $mock);
1000 $mock = $this->getMockBuilder(StringableClass::class)->getMock();
1002 $mock->method('__toString')->willReturn('foo');
1004 $this->assertSame('foo', (string) $mock);
1021 $mock = $this->getMockBuilder(Foo::class)->setMethods(['bar'])->getMock();
1025 $mock->expects($this->exactly($expectedNumberOfCalls))->method('bar')
1031 $mock->bar('call_' . $i);