Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Update phpunit #131

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update the mock calls
  • Loading branch information
mikeSimonson committed Feb 25, 2017
commit ed4685e1aafd9eb9cbdd134f32c1432b7a52985f
8 changes: 4 additions & 4 deletions tests/Doctrine/Tests/ODM/CouchDB/AttachmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testCreateFromBase64Data()

public function testCreateStub()
{
$httpClient = $this->getMock('Doctrine\CouchDB\HTTP\Client');
$httpClient = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client')->getMock();
$httpClient->expects($this->never())->method('request');
$attachment = Attachment::createStub('plain/text', 28, 2, $httpClient, '/');

Expand All @@ -47,7 +47,7 @@ public function testTriggerStubLazyLoad()
$path = '/';

$response = new \Doctrine\CouchDB\HTTP\Response(200, array(), 'Hello i am a string', true);
$httpClient = $this->getMock('Doctrine\CouchDB\HTTP\Client');
$httpClient = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client')->getMock();
$httpClient->expects($this->once())
->method('request')
->with($this->equalTo('GET'), $this->equalTo($path))
Expand All @@ -65,7 +65,7 @@ public function testTriggerLazyLoadOfMissingAttachmentThrowsException()
$path = '/';

$errorResponse = new \Doctrine\CouchDB\HTTP\ErrorResponse(404, array(), '{"error":"not_found","reason":"missing"}');
$httpClient = $this->getMock('Doctrine\CouchDB\HTTP\Client');
$httpClient = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client')->getMock();
$httpClient->expects($this->once())
->method('request')
->with($this->equalTo('GET'), $this->equalTo($path))
Expand All @@ -86,7 +86,7 @@ public function testToArray()

public function testToArrayStub()
{
$httpClient = $this->getMock('Doctrine\CouchDB\HTTP\Client');
$httpClient = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client')->getMock();
$httpClient->expects($this->never())->method('request');
$attachment = Attachment::createStub('plain/text', 28, 2, $httpClient, '/');

Expand Down
4 changes: 3 additions & 1 deletion tests/Doctrine/Tests/ODM/CouchDB/Proxy/ProxyFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function testReferenceProxyDelegatesLoadingToThePersister()

$query = array('documentName' => '\\'.$modelClass, 'id' => 'SomeUUID');

$uowMock = $this->getMock('Doctrine\ODM\CouchDB\UnitOfWork', array('refresh'), array(), '', false);
$uowMock = $this->getMockBuilder('Doctrine\ODM\CouchDB\UnitOfWork', array('refresh'), array(), '', false)
->disableOriginalConstructor()
->getMock();
$uowMock->expects($this->atLeastOnce())
->method('refresh')
->with($this->isInstanceOf($proxyClass));
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ODM/CouchDB/UnitOfWorkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testTryGetById()

public function testScheduleInsertion()
{
$httpClient = $this->getMock('Doctrine\CouchDB\HTTP\Client', array(), array(), '', false);
$httpClient = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client', array(), array(), '', false)->getMock();
$httpClient->expects($this->once())
->method('request')
->will($this->returnValue(new \Doctrine\CouchDB\HTTP\Response(404, array(), "{}")));
Expand Down Expand Up @@ -102,7 +102,7 @@ public function testScheduleInsert_ForUuidGenerator_QueriesUuidGenerator()
);
$uuidResponse = new \Doctrine\CouchDB\HTTP\Response(200, array(), json_encode(array('uuids' => $uuids)));

$client = $this->getMock('Doctrine\CouchDB\HTTP\Client');
$client = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client')->getMock();
$client->expects($this->once())
->method('request')
->with($this->equalTo('GET'), $this->equalTo('/_uuids?count=20'))
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ODM/CouchDB/View/LuceneQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function testExecute()
}
JSO;

$doc = $this->getMock('Doctrine\CouchDB\View\DesignDocument');
$doc = $this->getMockBuilder('Doctrine\CouchDB\View\DesignDocument')->getMock();
$doc->expects($this->once())
->method('getData')
->will($this->returnValue(array()));

$client = $this->getMock('Doctrine\CouchDB\HTTP\Client', array(), array(), '', false);
$client = $this->getMockBuilder('Doctrine\CouchDB\HTTP\Client', array(), array(), '', false)->getMock();

$client->expects($this->at(0))
->method('request')
Expand Down