Skip to content
Permalink
Browse files

Remove use of TestCase::getMock() from "Collection" namepace tests.

  • Loading branch information...
ADmad committed Jun 4, 2016
1 parent 3270507 commit ee02ce9ecb6d7cad2cd2d401eb62a7a6816a31d9
@@ -82,7 +82,9 @@ public function testEeach()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a');
@@ -118,7 +120,10 @@ public function testFilterChaining()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->once())
->method('__invoke')
->with(3, 'c');
@@ -156,7 +161,10 @@ public function testEveryReturnTrue()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a')
@@ -181,7 +189,10 @@ public function testEveryReturnFalse()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a')
@@ -195,7 +206,10 @@ public function testEveryReturnFalse()
$items = [];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->never())
->method('__invoke');
$this->assertFalse($collection->every($callable));
@@ -210,7 +224,10 @@ public function testSomeReturnTrue()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a')
@@ -232,7 +249,10 @@ public function testSomeReturnFalse()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a')
@@ -289,7 +309,10 @@ public function testReduceWithInitialValue()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(10, 1, 'a')
@@ -314,7 +337,10 @@ public function testReduceWithoutInitialValue()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 2, 'b')
@@ -759,7 +785,10 @@ public function testCompile()
{
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 'a')
@@ -32,7 +32,9 @@ class FilterIteratorTest extends TestCase
public function testFilter()
{
$items = new \ArrayIterator([1, 2, 3]);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 0, $items)
@@ -32,7 +32,9 @@ class ReplaceIteratorTest extends TestCase
public function testReplace()
{
$items = new \ArrayIterator([1, 2, 3]);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable = $this->getMockBuilder(\StdClass::class)
->setMethods(['__invoke'])
->getMock();
$callable->expects($this->at(0))
->method('__invoke')
->with(1, 0, $items)

0 comments on commit ee02ce9

Please sign in to comment.
You can’t perform that action at this time.