Skip to content

Commit

Permalink
Don't use createMock()
Browse files Browse the repository at this point in the history
It doesn't exist in PHPUnit 4.x
  • Loading branch information
markstory committed Jun 7, 2016
1 parent 494c848 commit 84a07bb
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions tests/TestCase/TestSuite/TestFixtureTest.php
Expand Up @@ -319,7 +319,9 @@ public function testInitNoImportNoFields()
public function testCreate()
{
$fixture = new ArticlesFixture();
$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$table = $this->getMockBuilder('Cake\Database\Schema\Table')
->setConstructorArgs(['articles'])
->getMock();
Expand Down Expand Up @@ -349,7 +351,9 @@ public function testCreate()
public function testCreateError()
{
$fixture = new ArticlesFixture();
$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$table = $this->getMockBuilder('Cake\Database\Schema\Table')
->setConstructorArgs(['articles'])
->getMock();
Expand All @@ -371,7 +375,9 @@ public function testInsert()
{
$fixture = new ArticlesFixture();

$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$query = $this->getMockBuilder('Cake\Database\Query')
->setConstructorArgs([$db])
->getMock();
Expand Down Expand Up @@ -427,7 +433,9 @@ public function testInsertImport()
{
$fixture = new ImportsFixture();

$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$query = $this->getMockBuilder('Cake\Database\Query')
->setConstructorArgs([$db])
->getMock();
Expand Down Expand Up @@ -473,7 +481,9 @@ public function testInsertStrings()
{
$fixture = new StringsTestsFixture();

$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$query = $this->getMockBuilder('Cake\Database\Query')
->setConstructorArgs([$db])
->getMock();
Expand Down Expand Up @@ -529,7 +539,9 @@ public function testDrop()
{
$fixture = new ArticlesFixture();

$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$statement = $this->getMockBuilder('\PDOStatement')
->setMethods(['closeCursor'])
->getMock();
Expand Down Expand Up @@ -559,7 +571,9 @@ public function testTruncate()
{
$fixture = new ArticlesFixture();

$db = $this->createMock('Cake\Database\Connection');
$db = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$statement = $this->getMockBuilder('\PDOStatement')
->setMethods(['closeCursor'])
->getMock();
Expand Down

0 comments on commit 84a07bb

Please sign in to comment.