diff --git a/controller/translationcontroller.php b/controller/translationcontroller.php index 32922e29..71f33013 100644 --- a/controller/translationcontroller.php +++ b/controller/translationcontroller.php @@ -14,7 +14,7 @@ namespace OCA\Passman\Controller; use OCP\IRequest; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\ApiController; -use \OCP\IL10N; +use OCP\IL10N; class TranslationController extends ApiController { private $trans; diff --git a/tests/unit/controller/TranslationControllerTest.php b/tests/unit/controller/TranslationControllerTest.php new file mode 100644 index 00000000..b7301bc6 --- /dev/null +++ b/tests/unit/controller/TranslationControllerTest.php @@ -0,0 +1,57 @@ +. + * + */ + +namespace OCA\Passman\Controller; + +use OCP\AppFramework\Http\JSONResponse; +use PHPUnit_Framework_TestCase; + + +/** + * Class PageControllerTest + * + * @package OCA\Passman\Controller + * @coversDefaultClass \OCA\Passman\Controller\PageController + */ +class TranslationControllerTest extends PHPUnit_Framework_TestCase { + + private $controller; + private $userId = 'john'; + + public function setUp() { + $request = $this->getMockBuilder('OCP\IRequest')->getMock(); + $IL10N = $this->getMockBuilder('OCP\IL10N')->getMock(); + + $this->controller = new TranslationController( + 'passman', $request, $IL10N + ); + } + + /** + * @covers ::getLanguageStrings + */ + public function getLanguageStrings() { + $result = $this->controller->getLanguageStrings(); + $this->assertTrue($result instanceof JSONResponse); + } +} \ No newline at end of file