@@ -29,17 +29,17 @@ |
||
| 29 | 29 | |
| 30 | 30 | class ParticipationMapperTest extends UnitTestCase { |
| 31 | 31 | |
| 32 | - /** @var IDBConnection */ |
|
| 33 | - private $con; |
|
| 34 | - /** @var ParticipationMapper */ |
|
| 35 | - private $participationMapper; |
|
| 32 | + /** @var IDBConnection */ |
|
| 33 | + private $con; |
|
| 34 | + /** @var ParticipationMapper */ |
|
| 35 | + private $participationMapper; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * {@inheritDoc} |
|
| 39 | - */ |
|
| 40 | - public function setUp() { |
|
| 41 | - parent::setUp(); |
|
| 42 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
| 43 | - $this->participationMapper = new ParticipationMapper($this->con); |
|
| 44 | - } |
|
| 37 | + /** |
|
| 38 | + * {@inheritDoc} |
|
| 39 | + */ |
|
| 40 | + public function setUp() { |
|
| 41 | + parent::setUp(); |
|
| 42 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
| 43 | + $this->participationMapper = new ParticipationMapper($this->con); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -29,17 +29,17 @@ |
||
| 29 | 29 | |
| 30 | 30 | class TextMapperTest extends UnitTestCase { |
| 31 | 31 | |
| 32 | - /** @var IDBConnection */ |
|
| 33 | - private $con; |
|
| 34 | - /** @var TextMapper */ |
|
| 35 | - private $textMapper; |
|
| 32 | + /** @var IDBConnection */ |
|
| 33 | + private $con; |
|
| 34 | + /** @var TextMapper */ |
|
| 35 | + private $textMapper; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * {@inheritDoc} |
|
| 39 | - */ |
|
| 40 | - public function setUp() { |
|
| 41 | - parent::setUp(); |
|
| 42 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
| 43 | - $this->textMapper = new TextMapper($this->con); |
|
| 44 | - } |
|
| 37 | + /** |
|
| 38 | + * {@inheritDoc} |
|
| 39 | + */ |
|
| 40 | + public function setUp() { |
|
| 41 | + parent::setUp(); |
|
| 42 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
| 43 | + $this->textMapper = new TextMapper($this->con); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -29,85 +29,85 @@ |
||
| 29 | 29 | |
| 30 | 30 | class PageControllerTest extends UnitTestCase { |
| 31 | 31 | |
| 32 | - /** @var PageController */ |
|
| 33 | - private $controller; |
|
| 32 | + /** @var PageController */ |
|
| 33 | + private $controller; |
|
| 34 | 34 | |
| 35 | - private $userId = 'john'; |
|
| 35 | + private $userId = 'john'; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * {@inheritDoc} |
|
| 39 | - */ |
|
| 40 | - public function setUp() { |
|
| 41 | - $request = $this->getMockBuilder('OCP\IRequest') |
|
| 42 | - ->disableOriginalConstructor() |
|
| 43 | - ->getMock(); |
|
| 44 | - $userManager = $this->getMockBuilder('OCP\IUserManager') |
|
| 45 | - ->disableOriginalConstructor() |
|
| 46 | - ->getMock(); |
|
| 47 | - $groupManager = $this->getMockBuilder('OCP\IGroupManager') |
|
| 48 | - ->disableOriginalConstructor() |
|
| 49 | - ->getMock(); |
|
| 50 | - $avatarManager = $this->getMockBuilder('OCP\IAvatarManager') |
|
| 51 | - ->disableOriginalConstructor() |
|
| 52 | - ->getMock(); |
|
| 53 | - $logger = $this->getMockBuilder('OCP\ILogger') |
|
| 54 | - ->disableOriginalConstructor() |
|
| 55 | - ->getMock(); |
|
| 56 | - $l10n = $this->getMockBuilder('OCP\IL10N') |
|
| 57 | - ->disableOriginalConstructor() |
|
| 58 | - ->getMock(); |
|
| 59 | - $urlGenerator = $this->getMockBuilder('OCP\IURLGenerator') |
|
| 60 | - ->disableOriginalConstructor() |
|
| 61 | - ->getMock(); |
|
| 62 | - $commentMapper = $this->getMockBuilder('OCA\Polls\Db\CommentMapper') |
|
| 63 | - ->disableOriginalConstructor() |
|
| 64 | - ->getMock(); |
|
| 65 | - $dateMapper = $this->getMockBuilder('OCA\Polls\Db\DateMapper') |
|
| 66 | - ->disableOriginalConstructor() |
|
| 67 | - ->getMock(); |
|
| 68 | - $eventMapper = $this->getMockBuilder('OCA\Polls\Db\EventMapper') |
|
| 69 | - ->disableOriginalConstructor() |
|
| 70 | - ->getMock(); |
|
| 71 | - $notificationMapper = $this->getMockBuilder('OCA\Polls\Db\NotificationMapper') |
|
| 72 | - ->disableOriginalConstructor() |
|
| 73 | - ->getMock(); |
|
| 74 | - $participationMapper = $this->getMockBuilder('OCA\Polls\Db\ParticipationMapper') |
|
| 75 | - ->disableOriginalConstructor() |
|
| 76 | - ->getMock(); |
|
| 77 | - $participationTextMapper = $this->getMockBuilder('OCA\Polls\Db\ParticipationTextMapper') |
|
| 78 | - ->disableOriginalConstructor() |
|
| 79 | - ->getMock(); |
|
| 80 | - $textMapper = $this->getMockBuilder('OCA\Polls\Db\TextMapper') |
|
| 81 | - ->disableOriginalConstructor() |
|
| 82 | - ->getMock(); |
|
| 37 | + /** |
|
| 38 | + * {@inheritDoc} |
|
| 39 | + */ |
|
| 40 | + public function setUp() { |
|
| 41 | + $request = $this->getMockBuilder('OCP\IRequest') |
|
| 42 | + ->disableOriginalConstructor() |
|
| 43 | + ->getMock(); |
|
| 44 | + $userManager = $this->getMockBuilder('OCP\IUserManager') |
|
| 45 | + ->disableOriginalConstructor() |
|
| 46 | + ->getMock(); |
|
| 47 | + $groupManager = $this->getMockBuilder('OCP\IGroupManager') |
|
| 48 | + ->disableOriginalConstructor() |
|
| 49 | + ->getMock(); |
|
| 50 | + $avatarManager = $this->getMockBuilder('OCP\IAvatarManager') |
|
| 51 | + ->disableOriginalConstructor() |
|
| 52 | + ->getMock(); |
|
| 53 | + $logger = $this->getMockBuilder('OCP\ILogger') |
|
| 54 | + ->disableOriginalConstructor() |
|
| 55 | + ->getMock(); |
|
| 56 | + $l10n = $this->getMockBuilder('OCP\IL10N') |
|
| 57 | + ->disableOriginalConstructor() |
|
| 58 | + ->getMock(); |
|
| 59 | + $urlGenerator = $this->getMockBuilder('OCP\IURLGenerator') |
|
| 60 | + ->disableOriginalConstructor() |
|
| 61 | + ->getMock(); |
|
| 62 | + $commentMapper = $this->getMockBuilder('OCA\Polls\Db\CommentMapper') |
|
| 63 | + ->disableOriginalConstructor() |
|
| 64 | + ->getMock(); |
|
| 65 | + $dateMapper = $this->getMockBuilder('OCA\Polls\Db\DateMapper') |
|
| 66 | + ->disableOriginalConstructor() |
|
| 67 | + ->getMock(); |
|
| 68 | + $eventMapper = $this->getMockBuilder('OCA\Polls\Db\EventMapper') |
|
| 69 | + ->disableOriginalConstructor() |
|
| 70 | + ->getMock(); |
|
| 71 | + $notificationMapper = $this->getMockBuilder('OCA\Polls\Db\NotificationMapper') |
|
| 72 | + ->disableOriginalConstructor() |
|
| 73 | + ->getMock(); |
|
| 74 | + $participationMapper = $this->getMockBuilder('OCA\Polls\Db\ParticipationMapper') |
|
| 75 | + ->disableOriginalConstructor() |
|
| 76 | + ->getMock(); |
|
| 77 | + $participationTextMapper = $this->getMockBuilder('OCA\Polls\Db\ParticipationTextMapper') |
|
| 78 | + ->disableOriginalConstructor() |
|
| 79 | + ->getMock(); |
|
| 80 | + $textMapper = $this->getMockBuilder('OCA\Polls\Db\TextMapper') |
|
| 81 | + ->disableOriginalConstructor() |
|
| 82 | + ->getMock(); |
|
| 83 | 83 | |
| 84 | - $this->controller = new PageController( |
|
| 85 | - 'polls', |
|
| 86 | - $request, |
|
| 87 | - $userManager, |
|
| 88 | - $groupManager, |
|
| 89 | - $avatarManager, |
|
| 90 | - $logger, |
|
| 91 | - $l10n, |
|
| 92 | - $urlGenerator, |
|
| 93 | - $this->userId, |
|
| 94 | - $commentMapper, |
|
| 95 | - $dateMapper, |
|
| 96 | - $eventMapper, |
|
| 97 | - $notificationMapper, |
|
| 98 | - $participationMapper, |
|
| 99 | - $participationTextMapper, |
|
| 100 | - $textMapper |
|
| 101 | - ); |
|
| 102 | - } |
|
| 84 | + $this->controller = new PageController( |
|
| 85 | + 'polls', |
|
| 86 | + $request, |
|
| 87 | + $userManager, |
|
| 88 | + $groupManager, |
|
| 89 | + $avatarManager, |
|
| 90 | + $logger, |
|
| 91 | + $l10n, |
|
| 92 | + $urlGenerator, |
|
| 93 | + $this->userId, |
|
| 94 | + $commentMapper, |
|
| 95 | + $dateMapper, |
|
| 96 | + $eventMapper, |
|
| 97 | + $notificationMapper, |
|
| 98 | + $participationMapper, |
|
| 99 | + $participationTextMapper, |
|
| 100 | + $textMapper |
|
| 101 | + ); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Basic controller index route test. |
|
| 106 | - */ |
|
| 107 | - public function testIndex() { |
|
| 108 | - $result = $this->controller->index(); |
|
| 104 | + /** |
|
| 105 | + * Basic controller index route test. |
|
| 106 | + */ |
|
| 107 | + public function testIndex() { |
|
| 108 | + $result = $this->controller->index(); |
|
| 109 | 109 | |
| 110 | - $this->assertEquals('main.tmpl', $result->getTemplateName()); |
|
| 111 | - $this->assertInstanceOf(TemplateResponse::class, $result); |
|
| 112 | - } |
|
| 110 | + $this->assertEquals('main.tmpl', $result->getTemplateName()); |
|
| 111 | + $this->assertInstanceOf(TemplateResponse::class, $result); |
|
| 112 | + } |
|
| 113 | 113 | } |
@@ -28,15 +28,15 @@ |
||
| 28 | 28 | |
| 29 | 29 | abstract class UnitTestCase extends PHPUnit_Framework_TestCase { |
| 30 | 30 | |
| 31 | - /** @var FactoryMuffin */ |
|
| 32 | - protected $fm; |
|
| 31 | + /** @var FactoryMuffin */ |
|
| 32 | + protected $fm; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * {@inheritDoc} |
|
| 36 | - */ |
|
| 37 | - public function setUp() { |
|
| 38 | - parent::setUp(); |
|
| 39 | - $this->fm = new FactoryMuffin(); |
|
| 40 | - $this->fm->loadFactories(__DIR__ . '/Factories'); |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * {@inheritDoc} |
|
| 36 | + */ |
|
| 37 | + public function setUp() { |
|
| 38 | + parent::setUp(); |
|
| 39 | + $this->fm = new FactoryMuffin(); |
|
| 40 | + $this->fm->loadFactories(__DIR__ . '/Factories'); |
|
| 41 | + } |
|
| 42 | 42 | } |