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
4 changed files
with
112 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace ICanBoogie\Module; | ||
|
||
use ICanBoogie\ActiveRecord\ConnectionCollection; | ||
use ICanBoogie\ActiveRecord\Model; | ||
|
||
class ModelCollectionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function test_should_return_true_if_model_exists_in_model_collection() | ||
{ | ||
$connections = $this->getMockBuilder(ConnectionCollection::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$modules = $this->getMockBuilder(ModuleCollection::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$model_id = uniqid(); | ||
|
||
$definitions = [ | ||
|
||
$model_id => [ | ||
|
||
Model::SCHEMA => [] | ||
|
||
] | ||
|
||
]; | ||
|
||
/* @var $connections ConnectionCollection */ | ||
/* @var $modules ModuleCollection */ | ||
|
||
$collection = new ModelCollection($connections, $modules, $definitions); | ||
|
||
$this->assertTrue($collection->offsetExists($model_id)); | ||
} | ||
} |