Skip to content

Commit

Permalink
[TESTS] Update older unit tests to use \Pimple\Container
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Dec 17, 2014
1 parent 4b32231 commit 06fb3f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/Elasticsearch/Tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testZeroRetries()

public function testConstructorEmptyPort()
{
$mockPimple = m::mock('Pimple')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockPimple = m::mock('\Pimple\Container')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockDIC = m::mock('DICBuilder')->shouldReceive('getDIC')->once()->andReturn($mockPimple)->getMock();

$that = $this; //hurp durp
Expand All @@ -143,7 +143,7 @@ public function testConstructorEmptyPort()

public function testConstructorNoPort()
{
$mockPimple = m::mock('Pimple')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockPimple = m::mock('\Pimple\Container')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockDIC = m::mock('DICBuilder')->shouldReceive('getDIC')->once()->andReturn($mockPimple)->getMock();

$that = $this; //hurp durp
Expand All @@ -163,7 +163,7 @@ public function testConstructorNoPort()

public function testConstructorWithPort()
{
$mockPimple = m::mock('Pimple')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockPimple = m::mock('\Pimple\Container')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockDIC = m::mock('DICBuilder')->shouldReceive('getDIC')->once()->andReturn($mockPimple)->getMock();

$that = $this; //hurp durp
Expand All @@ -183,7 +183,7 @@ public function testConstructorWithPort()

public function testConstructorWithSchemeAndPort()
{
$mockPimple = m::mock('Pimple')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockPimple = m::mock('\Pimple\Container')->shouldReceive('offsetGet')->getMock()->shouldReceive('offsetSet')->getMock();
$mockDIC = m::mock('DICBuilder')->shouldReceive('getDIC')->once()->andReturn($mockPimple)->getMock();

$that = $this; //hurp durp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCreate()
};

// Eww...
$mockPimple = m::mock('Pimple')
$mockPimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connection')->andReturn($mockFunction)->getMock()
->shouldReceive('offsetGet')->with('connectionParamsShared')->andReturn(array())->getMock()
->shouldReceive('offsetGet')->with('logObject')->andReturn(array())->getMock()
Expand Down
18 changes: 9 additions & 9 deletions tests/Elasticsearch/Tests/TransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testSniffOnStart()
};

// Eww...
$params = m::mock('Pimple')
$params = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -103,7 +103,7 @@ public function testSetRetries()
};

// Eww...
$params = m::mock('Pimple')
$params = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -136,7 +136,7 @@ public function testNoSniffOnStart()
};

// Eww...
$params = m::mock('Pimple')
$params = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -170,7 +170,7 @@ public function testMixedHosts()
};

// Eww...
$params = m::mock('Pimple')
$params = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -220,7 +220,7 @@ public function testPerformRequestNoBody()


// Eww...
$pimple = m::mock('Pimple')
$pimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -283,7 +283,7 @@ public function testPerformRequestWithBody()


// Eww...
$pimple = m::mock('Pimple')
$pimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -343,7 +343,7 @@ public function testPerformRequestTimeout()


// Eww...
$pimple = m::mock('Pimple')
$pimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down Expand Up @@ -400,7 +400,7 @@ public function testPerformRequestNoNodesAvailable()
$mockSerializer = m::mock('\Elasticsearch\Serializers\SerializerInterface');

// Eww...
$pimple = m::mock('Pimple')
$pimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
Expand Down Expand Up @@ -455,7 +455,7 @@ public function testPerformRequestTransportException()


// Eww...
$pimple = m::mock('Pimple')
$pimple = m::mock('\Pimple\Container')
->shouldReceive('offsetGet')->with('connectionPool')->andReturn($mockConnectionPoolFxn)->getMock()
->shouldReceive('offsetGet')->with('serializer')->andReturn($mockSerializer)->getMock()
->shouldReceive('offsetGet')->with('connection')->andReturn($mockConnectionFxn)->getMock()
Expand Down

0 comments on commit 06fb3f3

Please sign in to comment.