Skip to content

Commit

Permalink
Enhancement: Assert that OutputWriter can be injected
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Aug 18, 2015
1 parent 2816cbe commit df29f93
Showing 1 changed file with 43 additions and 0 deletions.
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()
;
}
}

0 comments on commit df29f93

Please sign in to comment.