From e68f7771860952e9eeaab8d47bd168595a7c5731 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 3 Apr 2017 17:24:51 +0200 Subject: Use PSR-4 naming for classes Signed-off-by: Christoph Wurst --- tests/unit/Controller/PageControllerTest.php | 48 ++++++++++++++++++++++++++++ tests/unit/controller/PageControllerTest.php | 48 ---------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 tests/unit/Controller/PageControllerTest.php delete mode 100644 tests/unit/controller/PageControllerTest.php (limited to 'tests/unit') diff --git a/tests/unit/Controller/PageControllerTest.php b/tests/unit/Controller/PageControllerTest.php new file mode 100644 index 00000000..548081da --- /dev/null +++ b/tests/unit/Controller/PageControllerTest.php @@ -0,0 +1,48 @@ + + * @copyright Hendrik Leppelsack 2015 + */ + +namespace OCA\Contacts\Controller; + +use PHPUnit_Framework_TestCase; + +use OCP\AppFramework\Http\TemplateResponse; + + +class PageControllerTest extends PHPUnit_Framework_TestCase { + + private $controller; + private $userId = 'john'; + + public function setUp() { + $request = $this->getMockBuilder('OCP\IRequest')->getMock(); + + $this->controller = new PageController( + 'contacts', $request, $this->userId + ); + } + + + public function testIndex() { + $result = $this->controller->index(); + + $this->assertEquals(['user' => 'john'], $result->getParams()); + $this->assertEquals('main', $result->getTemplateName()); + $this->assertTrue($result instanceof TemplateResponse); + } + + + public function testEcho() { + $result = $this->controller->doEcho('hi'); + $this->assertEquals(['echo' => 'hi'], $result->getData()); + } + + +} diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php deleted file mode 100644 index 548081da..00000000 --- a/tests/unit/controller/PageControllerTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright Hendrik Leppelsack 2015 - */ - -namespace OCA\Contacts\Controller; - -use PHPUnit_Framework_TestCase; - -use OCP\AppFramework\Http\TemplateResponse; - - -class PageControllerTest extends PHPUnit_Framework_TestCase { - - private $controller; - private $userId = 'john'; - - public function setUp() { - $request = $this->getMockBuilder('OCP\IRequest')->getMock(); - - $this->controller = new PageController( - 'contacts', $request, $this->userId - ); - } - - - public function testIndex() { - $result = $this->controller->index(); - - $this->assertEquals(['user' => 'john'], $result->getParams()); - $this->assertEquals('main', $result->getTemplateName()); - $this->assertTrue($result instanceof TemplateResponse); - } - - - public function testEcho() { - $result = $this->controller->doEcho('hi'); - $this->assertEquals(['echo' => 'hi'], $result->getData()); - } - - -} -- cgit v1.2.3