Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
498 additions
and
104 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
Empty file.
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,36 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the daikon-cqrs/dbal project. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Daikon\Tests\Dbal\Connector; | ||
|
||
use Daikon\Dbal\Connector\ConnectorInterface; | ||
use Daikon\Dbal\Connector\ConnectorMap; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class ConnectorMapTest extends TestCase | ||
{ | ||
public function testConstructWithSelf(): void | ||
{ | ||
$connectorMock = $this->createMock(ConnectorInterface::class); | ||
$connectorMap = new ConnectorMap(['mock' => $connectorMock]); | ||
$newMap = new ConnectorMap($connectorMap); | ||
$this->assertCount(1, $newMap); | ||
$this->assertNotSame($connectorMap, $newMap); | ||
$this->assertEquals($connectorMap, $newMap); | ||
} | ||
|
||
public function testPush(): void | ||
{ | ||
$emptyMap = new ConnectorMap; | ||
$connectorMock = $this->createMock(ConnectorInterface::class); | ||
$connectorMap = $emptyMap->with('mock', $connectorMock); | ||
$this->assertCount(1, $connectorMap); | ||
$this->assertEquals($connectorMock, $connectorMap->get('mock')); | ||
$this->assertTrue($emptyMap->isEmpty()); | ||
} | ||
} |
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,36 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the daikon-cqrs/dbal project. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Daikon\Tests\Dbal\Migration; | ||
|
||
use Daikon\Dbal\Migration\MigrationAdapterInterface; | ||
use Daikon\Dbal\Migration\MigrationAdapterMap; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class MigrationAdapterMapTest extends TestCase | ||
{ | ||
public function testConstructWithSelf(): void | ||
{ | ||
$adapterMock = $this->createMock(MigrationAdapterInterface::class); | ||
$adapterMap = new MigrationAdapterMap(['mock' => $adapterMock]); | ||
$newMap = new MigrationAdapterMap($adapterMap); | ||
$this->assertCount(1, $newMap); | ||
$this->assertNotSame($adapterMap, $newMap); | ||
$this->assertEquals($adapterMap, $newMap); | ||
} | ||
|
||
public function testPush(): void | ||
{ | ||
$emptyMap = new MigrationAdapterMap; | ||
$adapterMock = $this->createMock(MigrationAdapterInterface::class); | ||
$adapterMap = $emptyMap->with('mock', $adapterMock); | ||
$this->assertCount(1, $adapterMap); | ||
$this->assertEquals($adapterMock, $adapterMap->get('mock')); | ||
$this->assertTrue($emptyMap->isEmpty()); | ||
} | ||
} |