mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-12 10:15:44 +02:00

* Unit: Fix unittests Issue #171 * Tests: Move test namespace to the expected nextcloud namespace
35 lines
798 B
PHP
35 lines
798 B
PHP
<?php
|
|
/**
|
|
* Nextcloud - News
|
|
*
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
* later. See the COPYING file.
|
|
*
|
|
* @author Alessandro Cosentino <cosenal@gmail.com>
|
|
* @author Bernhard Posselt <dev@bernhard-posselt.com>
|
|
* @copyright Alessandro Cosentino 2012
|
|
* @copyright Bernhard Posselt 2012, 2014
|
|
*/
|
|
|
|
namespace OCA\News\Tests\Unit\Controller;
|
|
|
|
use OCA\News\Controller\JSONHttpError;
|
|
|
|
class Test {
|
|
use JSONHttpError;
|
|
}
|
|
|
|
class JSONHttpErrorTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
|
|
public function testError() {
|
|
$ex = new \Exception('hi');
|
|
$test = new Test();
|
|
$result = $test->error($ex, 3);
|
|
|
|
$this->assertEquals(['message' => 'hi'], $result->getData());
|
|
$this->assertEquals(3, $result->getStatus());
|
|
}
|
|
|
|
|
|
} |