File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ protected function setUp()
1515 }
1616
1717 /**
18- * Tests that when there is nothing to mapMapping an invalid Generator is returned.
18+ * Tests that when there is nothing to map an invalid Generator is returned.
1919 */
2020 public function testMapNothing ()
2121 {
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest \Integration \Mapper \Strategy ;
3+
4+ use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
5+ use ScriptFUSION \Mapper \Mapper ;
6+ use ScriptFUSION \Mapper \Strategy \Context ;
7+ use ScriptFUSION \Mapper \Strategy \Strategy ;
8+
9+ final class ContextTest extends \PHPUnit_Framework_TestCase
10+ {
11+ use MockeryPHPUnitIntegration;
12+
13+ public function test ()
14+ {
15+ /** @var Context $context */
16+ $ context = (new Context (
17+ \Mockery::mock (Strategy::class)
18+ ->shouldReceive ('__invoke ' )
19+ ->with ($ data = [], $ context = 'foo ' )
20+ ->once ()
21+ ->getMock (),
22+ $ context
23+ ))->setMapper (new Mapper );
24+
25+ $ context ($ data );
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest \Unit \Mapper \Strategy ;
3+
4+ use ScriptFUSION \Mapper \Mapper ;
5+ use ScriptFUSION \Mapper \Strategy \Merge ;
6+
7+ final class MergeTest extends \PHPUnit_Framework_TestCase
8+ {
9+ public function test ()
10+ {
11+ /** @var Merge $merge */
12+ $ merge = (new Merge ('foo ' , 'bar ' ))->setMapper (new Mapper );
13+
14+ self ::assertSame (['foo ' , 'bar ' ], $ merge ([]));
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest \Unit \Mapper \Strategy ;
3+
4+ use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
5+ use ScriptFUSION \Mapper \Strategy \Unique ;
6+ use ScriptFUSIONTest \MockFactory ;
7+
8+ final class UniqueTest extends \PHPUnit_Framework_TestCase
9+ {
10+ use MockeryPHPUnitIntegration;
11+
12+ public function test ()
13+ {
14+ /** @var Unique $unique */
15+ $ unique = (new Unique (null ))->setMapper (MockFactory::mockMapper (['foo ' => 'bar ' , 'baz ' => 'bar ' ]));
16+
17+ self ::assertSame (['foo ' => 'bar ' ], $ unique ([]));
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments