File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
spec/MageTest/PhpSpec/MagentoExtension/Extension Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace spec \MageTest \PhpSpec \MagentoExtension \Extension ;
4+
5+ use MageTest \PhpSpec \MagentoExtension \Extension \LocatorFactory ;
6+ use MageTest \PhpSpec \MagentoExtension \Locator \Magento \BlockLocator ;
7+ use MageTest \PhpSpec \MagentoExtension \Locator \Magento \ControllerLocator ;
8+ use MageTest \PhpSpec \MagentoExtension \Locator \Magento \HelperLocator ;
9+ use MageTest \PhpSpec \MagentoExtension \Locator \Magento \ModelLocator ;
10+ use PhpSpec \ObjectBehavior ;
11+ use Prophecy \Argument ;
12+
13+ class LocatorFactorySpec extends ObjectBehavior
14+ {
15+ function it_should_get_block_locator ()
16+ {
17+ $ this ->getLocator ('block ' )->shouldHaveType (BlockLocator::class);
18+ }
19+
20+ function it_should_get_model_locator ()
21+ {
22+ $ this ->getLocator ('model ' )->shouldHaveType (ModelLocator::class);
23+ }
24+
25+ function it_should_get_helper_locator ()
26+ {
27+ $ this ->getLocator ('helper ' )->shouldHaveType (HelperLocator::class);
28+ }
29+
30+ function it_should_get_controller_locator ()
31+ {
32+ $ this ->getLocator ('controller ' )->shouldHaveType (ControllerLocator::class);
33+ }
34+
35+ function it_should_throw_exception_when_an_unrecognised_type_is_used ()
36+ {
37+ $ this ->shouldThrow (\RuntimeException::class)->duringGetLocator ('foo ' );
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments