diff --git a/src/bb-modules/Client/Controller/Client.php b/src/bb-modules/Client/Controller/Client.php index 0727dfc08..2fe5b8ef4 100644 --- a/src/bb-modules/Client/Controller/Client.php +++ b/src/bb-modules/Client/Controller/Client.php @@ -94,7 +94,7 @@ class Client implements \Box\InjectionAwareInterface public function get_reset_password_confirm(\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); diff --git a/src/bb-modules/Currency/Controller/Admin.php b/src/bb-modules/Currency/Controller/Admin.php index 3b0eb4471..ec44eff1f 100644 --- a/src/bb-modules/Currency/Controller/Admin.php +++ b/src/bb-modules/Currency/Controller/Admin.php @@ -41,7 +41,7 @@ class Admin implements \Box\InjectionAwareInterface public function get_manage(\Box_App $app, $code) { $api = $app->getApiAdmin(); - $guest_api = $app->getApiGuest(); + $guest_api = $this->di['api_guest']; $currency = $guest_api->currency_get(array('code'=>$code)); return $app->render('mod_currency_manage', array('currency'=>$currency)); } diff --git a/src/bb-modules/Embed/Controller/Client.php b/src/bb-modules/Embed/Controller/Client.php index 56d3400d1..8911698eb 100644 --- a/src/bb-modules/Embed/Controller/Client.php +++ b/src/bb-modules/Embed/Controller/Client.php @@ -46,7 +46,6 @@ class Client implements \Box\InjectionAwareInterface public function get_object(\Box_App $app, $what) { - $api = $app->getApiGuest(); $tpl = 'mod_embed_'.$what; return $app->render($tpl); } diff --git a/src/bb-modules/Example/Controller/Client.php b/src/bb-modules/Example/Controller/Client.php index dafc4befb..7a99115c0 100644 --- a/src/bb-modules/Example/Controller/Client.php +++ b/src/bb-modules/Example/Controller/Client.php @@ -52,7 +52,6 @@ class Client implements \Box\InjectionAwareInterface public function get_index(\Box_App $app) { - $api = $app->getApiGuest(); return $app->render('mod_example_index'); } diff --git a/src/bb-modules/Forum/Controller/Client.php b/src/bb-modules/Forum/Controller/Client.php index 877edd078..4accde59c 100644 --- a/src/bb-modules/Forum/Controller/Client.php +++ b/src/bb-modules/Forum/Controller/Client.php @@ -55,7 +55,7 @@ class Client implements \Box\InjectionAwareInterface public function get_forum(\Box_App $app, $forum) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'slug' => $forum, ); @@ -65,7 +65,7 @@ class Client implements \Box\InjectionAwareInterface public function get_forum_topic(\Box_App $app, $forum, $topic) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'slug' => $forum, ); diff --git a/src/bb-modules/Invoice/Controller/Admin.php b/src/bb-modules/Invoice/Controller/Admin.php index d073c46a2..05e26b4cf 100644 --- a/src/bb-modules/Invoice/Controller/Admin.php +++ b/src/bb-modules/Invoice/Controller/Admin.php @@ -180,7 +180,7 @@ class Admin implements \Box\InjectionAwareInterface public function get_pdf (\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); diff --git a/src/bb-modules/Invoice/Controller/Client.php b/src/bb-modules/Invoice/Controller/Client.php index 2a850f1af..467da1f81 100644 --- a/src/bb-modules/Invoice/Controller/Client.php +++ b/src/bb-modules/Invoice/Controller/Client.php @@ -54,7 +54,7 @@ class Client implements \Box\InjectionAwareInterface public function get_invoice(\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); @@ -64,7 +64,7 @@ class Client implements \Box\InjectionAwareInterface public function get_invoice_print(\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); @@ -74,7 +74,7 @@ class Client implements \Box\InjectionAwareInterface public function get_thankyoupage(\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); @@ -84,7 +84,7 @@ class Client implements \Box\InjectionAwareInterface public function get_banklink(\Box_App $app, $hash, $id) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'subscription' => $this->di['request']->getQuery('subscription'), 'hash' => $hash, @@ -99,7 +99,7 @@ class Client implements \Box\InjectionAwareInterface public function get_pdf (\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); diff --git a/src/bb-modules/Kb/Controller/Client.php b/src/bb-modules/Kb/Controller/Client.php index dc8f32e6d..da13cd120 100644 --- a/src/bb-modules/Kb/Controller/Client.php +++ b/src/bb-modules/Kb/Controller/Client.php @@ -47,7 +47,7 @@ class Client implements \Box\InjectionAwareInterface public function get_kb_category(\Box_App $app, $category) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array('slug'=>$category); $model = $api->kb_category_get($data); return $app->render('mod_kb_category', array('category'=>$model)); @@ -55,7 +55,7 @@ class Client implements \Box\InjectionAwareInterface public function get_kb_article(\Box_App $app, $category, $slug) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array('slug'=>$slug); $article = $api->kb_article_get($data); return $app->render('mod_kb_article', array('article'=>$article)); diff --git a/src/bb-modules/Order/Controller/Client.php b/src/bb-modules/Order/Controller/Client.php index b0f08b954..fefa5bfba 100644 --- a/src/bb-modules/Order/Controller/Client.php +++ b/src/bb-modules/Order/Controller/Client.php @@ -50,7 +50,7 @@ class Client implements \Box\InjectionAwareInterface public function get_configure_product_by_slug(\Box_App $app, $slug) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $product = $api->product_get(array('slug'=>$slug)); $tpl = 'mod_service'.$product['type'].'_order'; if($api->system_template_exists(array('file'=>$tpl.'.phtml'))) { @@ -61,7 +61,7 @@ class Client implements \Box\InjectionAwareInterface public function get_configure_product(\Box_App $app, $id) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $product = $api->product_get(array('id'=>$id)); $tpl = 'mod_service'.$product['type'].'_order'; if($api->system_template_exists(array('file'=>$tpl.'.phtml'))) { diff --git a/src/bb-modules/Support/Controller/Client.php b/src/bb-modules/Support/Controller/Client.php index 322201166..10f5706ad 100644 --- a/src/bb-modules/Support/Controller/Client.php +++ b/src/bb-modules/Support/Controller/Client.php @@ -61,7 +61,7 @@ class Client implements \Box\InjectionAwareInterface public function get_contact_us_conversation(\Box_App $app, $hash) { - $api = $app->getApiGuest(); + $api = $this->di['api_guest']; $data = array( 'hash' => $hash, ); diff --git a/tests/bb-modules/Example/Controller/ClientTest.php b/tests/bb-modules/Example/Controller/ClientTest.php index f7247892e..15fee1712 100644 --- a/tests/bb-modules/Example/Controller/ClientTest.php +++ b/tests/bb-modules/Example/Controller/ClientTest.php @@ -32,8 +32,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase { public function testget_index() { $boxAppMock = $this->getMockBuilder('\Box_App')->disableOriginalConstructor()->getMock(); - $boxAppMock->expects($this->atLeastOnce()) - ->method('getApiGuest'); $boxAppMock->expects($this->atLeastOnce()) ->method('render') ->with('mod_example_index');