namespaces for tests
This commit is contained in:
parent
b44a33f68f
commit
d3692c3283
|
@ -1,6 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Test_Comments_Comment extends Test\TestCase
|
namespace Test\Comments;
|
||||||
|
|
||||||
|
use Test\TestCase;
|
||||||
|
|
||||||
|
class Test_Comments_Comment extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testSettersValidInput() {
|
public function testSettersValidInput() {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Test\Comments;
|
||||||
|
|
||||||
|
use Test\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Test_Comments_FakeFactory
|
* Class Test_Comments_FakeFactory
|
||||||
*
|
|
||||||
* this class does not contain any tests. It's sole purpose is to return
|
|
||||||
* a mock of \OCP\Comments\ICommentsManager when getManager() is called.
|
|
||||||
* For mock creation and auto-loading it extends Test\TestCase. I am, uh, really
|
|
||||||
* sorry for this hack.
|
|
||||||
*/
|
*/
|
||||||
class Test_Comments_FakeFactory extends Test\TestCase implements \OCP\Comments\ICommentsManagerFactory {
|
class Test_Comments_FakeFactory extends TestCase implements \OCP\Comments\ICommentsManagerFactory {
|
||||||
|
|
||||||
public function getManager() {
|
public function getManager() {
|
||||||
return $this->getMock('\OCP\Comments\ICommentsManager');
|
return $this->getMock('\OCP\Comments\ICommentsManager');
|
||||||
|
@ -20,7 +19,7 @@ class Test_Comments_FakeFactory extends Test\TestCase implements \OCP\Comments\I
|
||||||
|
|
||||||
$managerMock = $this->getMock('\OCP\Comments\ICommentsManager');
|
$managerMock = $this->getMock('\OCP\Comments\ICommentsManager');
|
||||||
|
|
||||||
$config->setSystemValue('comments.managerFactory', 'Test_Comments_FakeFactory');
|
$config->setSystemValue('comments.managerFactory', '\Test\Comments\Test_Comments_FakeFactory');
|
||||||
$manager = \OC::$server->getCommentsManager();
|
$manager = \OC::$server->getCommentsManager();
|
||||||
$this->assertEquals($managerMock, $manager);
|
$this->assertEquals($managerMock, $manager);
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Test\Comments;
|
||||||
|
|
||||||
use OCP\Comments\ICommentsManager;
|
use OCP\Comments\ICommentsManager;
|
||||||
|
use Test\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Test_Comments_Manager
|
* Class Test_Comments_Manager
|
||||||
*
|
*
|
||||||
* @group DB
|
* @group DB
|
||||||
*/
|
*/
|
||||||
class Test_Comments_Manager extends Test\TestCase
|
class Test_Comments_Manager extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
|
|
Loading…
Reference in New Issue