Skip to content
Permalink
Browse files

Don't use createMock()

It doesn't exist in PHPUnit 4.x
  • Loading branch information...
markstory committed Jun 7, 2016
1 parent 494c848 commit 84a07bb3c40d61d63102121f3579c083fb48649b
Showing with 21 additions and 7 deletions.
  1. +21 −7 tests/TestCase/TestSuite/TestFixtureTest.php
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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();

0 comments on commit 84a07bb

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