@@ 37-42 (lines=6) @@ | ||
34 | // IF YOU'RE OF A NERVOUS DISPOSITION, LOOK AWAY NOT |
|
35 | // stub the flushChanges method and make sure that each call is able to assert the correct items are in the |
|
36 | $mockExtension->expects($this->exactly(3))->method('flushChanges')->willReturnOnConsecutiveCalls( |
|
37 | new \PHPUnit_Framework_MockObject_Stub_ReturnCallback(function () use ($mockExtension, $getURL) { |
|
38 | $this->assertEmpty($mockExtension->getToDelete()); |
|
39 | $mockExtension->setToDelete([]); |
|
40 | $this->assertEquals(['stub'], array_map($getURL, $mockExtension->getToUpdate())); |
|
41 | $mockExtension->setToUpdate([]); |
|
42 | }), |
|
43 | new \PHPUnit_Framework_MockObject_Stub_ReturnCallback(function () use ($mockExtension, $getURL) { |
|
44 | $this->assertEquals(['stub'], array_map($getURL, $mockExtension->getToDelete())); |
|
45 | $mockExtension->setToDelete([]); |
|
@@ 43-48 (lines=6) @@ | ||
40 | $this->assertEquals(['stub'], array_map($getURL, $mockExtension->getToUpdate())); |
|
41 | $mockExtension->setToUpdate([]); |
|
42 | }), |
|
43 | new \PHPUnit_Framework_MockObject_Stub_ReturnCallback(function () use ($mockExtension, $getURL) { |
|
44 | $this->assertEquals(['stub'], array_map($getURL, $mockExtension->getToDelete())); |
|
45 | $mockExtension->setToDelete([]); |
|
46 | $this->assertEmpty($mockExtension->getToUpdate()); |
|
47 | $mockExtension->setToUpdate([]); |
|
48 | }), |
|
49 | new \PHPUnit_Framework_MockObject_Stub_ReturnCallback(function () use ($mockExtension, $getURL) { |
|
50 | $this->assertEmpty($mockExtension->getToDelete()); |
|
51 | $mockExtension->setToDelete([]); |
|
@@ 49-54 (lines=6) @@ | ||
46 | $this->assertEmpty($mockExtension->getToUpdate()); |
|
47 | $mockExtension->setToUpdate([]); |
|
48 | }), |
|
49 | new \PHPUnit_Framework_MockObject_Stub_ReturnCallback(function () use ($mockExtension, $getURL) { |
|
50 | $this->assertEmpty($mockExtension->getToDelete()); |
|
51 | $mockExtension->setToDelete([]); |
|
52 | $this->assertEquals(['stub-a-lub-a-dub-dub'], array_map($getURL, $mockExtension->getToUpdate())); |
|
53 | $mockExtension->setToUpdate([]); |
|
54 | }) |
|
55 | ); |
|
56 | ||
57 | // register our extension instance so it's applied to all SiteTree objects |