File tree Expand file tree Collapse file tree 6 files changed +23
-24
lines changed
spec/PHPCR/Shell/Console/Application Expand file tree Collapse file tree 6 files changed +23
-24
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ Changelog
44dev-master
55----------
66
7+ ### BC Break
8+
9+ - [ DoctrinePhpcrBundle] Shell must now be initiated in a different way in
10+ embedded mode. The DoctrinePhpcrBundle will need to be updated.
11+
712### Bug fixes
813
914- [ config] Do not override CLI options with profile options
Original file line number Diff line number Diff line change 55use PhpSpec \ObjectBehavior ;
66use PHPCR \Shell \Console \Application \EmbeddedApplication ;
77use Symfony \Component \DependencyInjection \ContainerInterface ;
8+ use PHPCR \Shell \PhpcrShell ;
9+ use PHPCR \Shell \DependencyInjection \Container ;
810
911class EmbeddedApplicationSpec extends ObjectBehavior
1012{
1113 public function let (
12- ContainerInterface $ container
14+ Container $ container
1315 )
1416 {
15- $ this ->beConstructedWith ($ container, EmbeddedApplication:: MODE_COMMAND );
17+ $ this ->beConstructedWith ($ container );
1618 }
1719
1820 public function it_is_initializable ()
Original file line number Diff line number Diff line change 55use PhpSpec \ObjectBehavior ;
66use Symfony \Component \DependencyInjection \ContainerInterface ;
77use PHPCR \Shell \Console \Application \EmbeddedApplication ;
8+ use PHPCR \Shell \PhpcrShell ;
89
910class ShellApplicationSpec extends ObjectBehavior
1011{
1112 public function let (
1213 ContainerInterface $ container
1314 )
1415 {
15- $ this ->beConstructedWith ($ container , EmbeddedApplication:: MODE_COMMAND );
16+ $ this ->beConstructedWith ($ container , PhpcrShell:: MODE_EMBEDDED_COMMAND );
1617 }
1718
1819 public function it_is_initializable ()
Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ public function offsetGet($offset)
3636 {
3737 if (isset ($ this ->data [$ offset ])) {
3838 $ value = $ this ->data [$ offset ];
39+
3940 if (is_array ($ value )) {
4041 return new self ($ value );
41- } else {
42- return $ value ;
4342 }
43+
44+ return $ value ;
4445 }
4546 }
4647
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ class Shell
1818 private $ output ;
1919 private $ hasReadline ;
2020 private $ prompt ;
21- private $ processIsolation ;
2221
2322 /**
2423 * Constructor.
@@ -35,7 +34,6 @@ public function __construct(Application $application)
3534 $ this ->history = getenv ('HOME ' ).'/.history_ ' .$ application ->getName ();
3635 $ this ->output = new ConsoleOutput ();
3736 $ this ->prompt = $ application ->getName ().' > ' ;
38- $ this ->processIsolation = false ;
3937 }
4038
4139 /**
@@ -129,14 +127,4 @@ private function readline()
129127
130128 return $ line ;
131129 }
132-
133- public function getProcessIsolation ()
134- {
135- return $ this ->processIsolation ;
136- }
137-
138- public function setProcessIsolation ($ processIsolation )
139- {
140- $ this ->processIsolation = (Boolean ) $ processIsolation ;
141- }
142130}
Original file line number Diff line number Diff line change 44
55use PHPCR \Shell \Console \Application \EmbeddedApplication ;
66use PHPCR \Shell \Phpcr \PhpcrSession ;
7+ use PHPCR \Shell \PhpcrShell ;
8+ use PHPCR \Shell \DependencyInjection \Container ;
79
810/**
9- * Features context.
11+ * Features context
12+ *
13+ * Start the shell in the embedded context
1014 */
1115class EmbeddedContext extends ContextBase
1216{
13- private $ application ;
14-
1517 protected function createTester ()
1618 {
1719 // embbed a new session
1820 $ session = $ this ->getSession (null , true );
21+ $ container = new Container (PhpcrShell::MODE_EMBEDDED_SHELL );
22+ $ container ->get ('phpcr.session_manager ' )->setSession (new PhpcrSession ($ session ));
23+ $ application = $ container ->get ('application ' );
1924
20- $ this ->application = new EmbeddedApplication (EmbeddedApplication::MODE_SHELL );
21- $ this ->application ->getHelperSet ()->get ('phpcr ' )->setSession (new PhpcrSession ($ session ));
22-
23- $ tester = new ApplicationTester ($ this ->application );
25+ $ tester = new ApplicationTester ($ application );
2426
2527 return $ tester ;
2628 }
You can’t perform that action at this time.
0 commit comments