-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Assert that OutputWriter can be injected
- Loading branch information
1 parent
2816cbe
commit df29f93
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
tests/Doctrine/DBAL/Migrations/Tests/Configuration/ConfigurationTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Migrations\Tests\Configuration; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Migrations\Configuration\Configuration; | ||
use Doctrine\DBAL\Migrations\OutputWriter; | ||
|
||
class ConfigurationTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testConstructorSetsOutputWriter() | ||
{ | ||
$outputWriter = $this->getOutputWriterMock(); | ||
|
||
$configuration = new Configuration( | ||
$this->getConnectionMock(), | ||
$outputWriter | ||
); | ||
|
||
$this->assertSame($outputWriter, $configuration->getOutputWriter()); | ||
} | ||
|
||
/** | ||
* @return \PHPUnit_Framework_MockObject_MockObject|Connection | ||
*/ | ||
private function getConnectionMock() | ||
{ | ||
return $this->getMockBuilder('Doctrine\DBAL\Connection') | ||
->disableOriginalConstructor() | ||
->getMock() | ||
; | ||
} | ||
/** | ||
* @return \PHPUnit_Framework_MockObject_MockObject|OutputWriter | ||
*/ | ||
private function getOutputWriterMock() | ||
{ | ||
return $this->getMockBuilder('Doctrine\DBAL\Migrations\OutputWriter') | ||
->disableOriginalConstructor() | ||
->getMock() | ||
; | ||
} | ||
} |