Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Fixed unit tests with new PHPUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Nov 29, 2017
1 parent 72270cc commit 507d4e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/Adapter/Driver/IbmDb2/StatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function testPreparingTwiceErrors()
$this->statement->prepare($sql);
$this->assertTrue($this->statement->isPrepared());

$this->setExpectedException(
$this->expectException(
RuntimeException::class,
'This statement has been prepared already'
);
Expand All @@ -146,7 +146,7 @@ public function testPrepareThrowsRuntimeExceptionOnInvalidSql()
$sql = "INVALID SQL";
$this->statement->setSql($sql);

$this->setExpectedException(
$this->expectException(
RuntimeException::class,
'SQL is invalid. Error message'
);
Expand All @@ -167,7 +167,7 @@ public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingD
$sql = "INVALID SQL";
$this->statement->setSql($sql);

$this->setExpectedException(
$this->expectException(
RuntimeException::class,
'Error message'
);
Expand Down
7 changes: 4 additions & 3 deletions test/Sql/Platform/Mysql/Ddl/AlterTableDecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

namespace ZendTest\Db\Sql\Platform\Mysql\Ddl;

use PHPUnit\Framework\TestCase;
use Zend\Db\Adapter\Platform\Mysql;
use Zend\Db\Sql\Ddl\AlterTable;
use Zend\Db\Sql\Ddl\Column\Column;
use Zend\Db\Sql\Ddl\Constraint\PrimaryKey;
use Zend\Db\Sql\Platform\Mysql\Ddl\AlterTableDecorator;

class AlterTableDecoratorTest extends \PHPUnit_Framework_TestCase
class AlterTableDecoratorTest extends TestCase
{
/**
* @covers Zend\Db\Sql\Platform\Mysql\Ddl\AlterTableDecorator::setSubject
Expand All @@ -24,7 +25,7 @@ public function testSetSubject()
{
$ctd = new AlterTableDecorator();
$ct = new AlterTable;
$this->assertSame($ctd, $ctd->setSubject($ct));
self::assertSame($ctd, $ctd->setSubject($ct));
}

/**
Expand All @@ -45,7 +46,7 @@ public function testGetSqlString()
$col->addConstraint(new PrimaryKey());
$ct->addColumn($col);

$this->assertEquals(
self::assertEquals(
"ALTER TABLE `foo`\n ADD COLUMN `bar` INTEGER UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'baz' AFTER `bar`",
@$ctd->getSqlString(new Mysql())
);
Expand Down

0 comments on commit 507d4e2

Please sign in to comment.