File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest ;
3+
4+ use ScriptFUSION \Mapper \Strategy \Decorator ;
5+
6+ final class DecoratorStub extends Decorator
7+ {
8+ public function getStrategyPublic ()
9+ {
10+ return $ this ->getStrategy ();
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest ;
3+
4+ use ScriptFUSION \Mapper \MapperAwareTrait ;
5+
6+ final class MapperAwareStub
7+ {
8+ use MapperAwareTrait;
9+
10+ public function getMapperPublic ()
11+ {
12+ return $ this ->getMapper ();
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest \Unit \Mapper ;
3+
4+ use ScriptFUSION \Mapper \Strategy \Strategy ;
5+ use ScriptFUSIONTest \DecoratorStub ;
6+
7+ final class DecoratorTest extends \PHPUnit_Framework_TestCase
8+ {
9+ public function testGetStrategy ()
10+ {
11+ $ decorator = new DecoratorStub ($ strategy = \Mockery::mock (Strategy::class));
12+
13+ self ::assertSame ($ strategy , $ decorator ->getStrategyPublic ());
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace ScriptFUSIONTest \Unit \Mapper ;
3+
4+ use ScriptFUSION \Mapper \Mapper ;
5+ use ScriptFUSIONTest \MapperAwareStub ;
6+
7+ final class MapperAwareTraitTest extends \PHPUnit_Framework_TestCase
8+ {
9+ public function testGetMapper ()
10+ {
11+ $ mapperAware = (new MapperAwareStub )->setMapper ($ mapper = \Mockery::mock (Mapper::class));
12+
13+ self ::assertSame ($ mapper , $ mapperAware ->getMapperPublic ());
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments