Passed
Pull Request — master (#224)
by Kai
02:11
created
tests/Unit/Controller/PageControllerTest.php 1 patch
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -29,85 +29,85 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
tests/Unit/UnitTestCase.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/Db/Model.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
 use OCP\AppFramework\Db\Entity;
27 27
 
28 28
 abstract class Model extends Entity {
29
-	/**
30
-	 * FactoryMuffin checks for the existence of setters with method_exists($obj, $attr) but that returns false.
31
-	 * By overwriting the __set() magic method we can trigger the changed flag on $obj->attr assignment.
32
-	 *
33
-	 * @param $name
34
-	 * @param $value
35
-	 */
36
-	public function __set($name, $value) {
37
-		$this->setter($name, [$value]);
38
-	}
29
+    /**
30
+     * FactoryMuffin checks for the existence of setters with method_exists($obj, $attr) but that returns false.
31
+     * By overwriting the __set() magic method we can trigger the changed flag on $obj->attr assignment.
32
+     *
33
+     * @param $name
34
+     * @param $value
35
+     */
36
+    public function __set($name, $value) {
37
+        $this->setter($name, [$value]);
38
+    }
39 39
 }
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -37,130 +37,130 @@
 block discarded – undo
37 37
 
38 38
 class Application extends App {
39 39
 
40
-	/**
41
-	 * Application constructor.
42
-	 * @param array $urlParams
43
-	 */
44
-	public function __construct(array $urlParams = array()) {
45
-		parent::__construct('polls', $urlParams);
46
-
47
-		$container = $this->getContainer();
48
-		$server = $container->getServer();
49
-
50
-		/**
51
-		 * Controllers
52
-		 */
53
-		$container->registerService('PageController', function ($c) use ($server) {
54
-			/** @var SimpleContainer $c */
55
-			return new PageController(
56
-				$c->query('AppName'),
57
-				$c->query('Request'),
58
-				$c->query('UserManager'),
59
-				$c->query('GroupManager'),
60
-				$c->query('AvatarManager'),
61
-				$c->query('Logger'),
62
-				$c->query('L10N'),
63
-				$c->query('ServerContainer')->getURLGenerator(),
64
-				$c->query('UserId'),
65
-				$c->query('CommentMapper'),
66
-				$c->query('DateMapper'),
67
-				$c->query('EventMapper'),
68
-				$c->query('NotificationMapper'),
69
-				$c->query('ParticipationMapper'),
70
-				$c->query('ParticipationTextMapper'),
71
-				$c->query('TextMapper')
72
-			);
73
-		});
74
-
75
-		$container->registerService('UserManager', function ($c) {
76
-			/** @var SimpleContainer $c */
77
-			return $c->query('ServerContainer')->getUserManager();
78
-		});
79
-
80
-		$container->registerService('GroupManager', function ($c) {
81
-			/** @var SimpleContainer $c */
82
-			return $c->query('ServerContainer')->getGroupManager();
83
-		});
84
-
85
-		$container->registerService('AvatarManager', function ($c) {
86
-			/** @var SimpleContainer $c */
87
-			return $c->query('ServerContainer')->getAvatarManager();
88
-		});
89
-
90
-		$container->registerService('Logger', function ($c) {
91
-			/** @var SimpleContainer $c */
92
-			return $c->query('ServerContainer')->getLogger();
93
-		});
94
-
95
-		$container->registerService('L10N', function ($c) {
96
-			return $c->query('ServerContainer')->getL10N($c->query('AppName'));
97
-		});
98
-
99
-		$container->registerService('CommentMapper', function ($c) use ($server) {
100
-			/** @var SimpleContainer $c */
101
-			return new CommentMapper(
102
-				$server->getDatabaseConnection()
103
-			);
104
-		});
105
-
106
-		$container->registerService('DateMapper', function ($c) use ($server) {
107
-			/** @var SimpleContainer $c */
108
-			return new DateMapper(
109
-				$server->getDatabaseConnection()
110
-			);
111
-		});
112
-
113
-		$container->registerService('EventMapper', function ($c) use ($server) {
114
-			/** @var SimpleContainer $c */
115
-			return new EventMapper(
116
-				$server->getDatabaseConnection()
117
-			);
118
-		});
119
-
120
-		$container->registerService('NotificationMapper', function ($c) use ($server) {
121
-			/** @var SimpleContainer $c */
122
-			return new NotificationMapper(
123
-				$server->getDatabaseConnection()
124
-			);
125
-		});
126
-
127
-		$container->registerService('ParticipationMapper', function ($c) use ($server) {
128
-			/** @var SimpleContainer $c */
129
-			return new ParticipationMapper(
130
-				$server->getDatabaseConnection()
131
-			);
132
-		});
133
-
134
-		$container->registerService('ParticipationTextMapper', function ($c) use ($server) {
135
-			/** @var SimpleContainer $c */
136
-			return new ParticipationTextMapper(
137
-				$server->getDatabaseConnection()
138
-			);
139
-		});
140
-
141
-		$container->registerService('TextMapper', function ($c) use ($server) {
142
-			/** @var SimpleContainer $c */
143
-			return new TextMapper(
144
-				$server->getDatabaseConnection()
145
-			);
146
-		});
147
-	}
148
-
149
-	/**
150
-	 * Register navigation entry for main navigation.
151
-	 */
152
-	public function registerNavigationEntry() {
153
-		$container = $this->getContainer();
154
-		$container->query('OCP\INavigationManager')->add(function () use ($container) {
155
-			$urlGenerator = $container->query('OCP\IURLGenerator');
156
-			$l10n = $container->query('OCP\IL10N');
157
-			return [
158
-				'id' => 'polls',
159
-				'order' => 77,
160
-				'href' => $urlGenerator->linkToRoute('polls.page.index'),
161
-				'icon' => $urlGenerator->imagePath('polls', 'app.svg'),
162
-				'name' => $l10n->t('Polls')
163
-			];
164
-		});
165
-	}
40
+    /**
41
+     * Application constructor.
42
+     * @param array $urlParams
43
+     */
44
+    public function __construct(array $urlParams = array()) {
45
+        parent::__construct('polls', $urlParams);
46
+
47
+        $container = $this->getContainer();
48
+        $server = $container->getServer();
49
+
50
+        /**
51
+         * Controllers
52
+         */
53
+        $container->registerService('PageController', function ($c) use ($server) {
54
+            /** @var SimpleContainer $c */
55
+            return new PageController(
56
+                $c->query('AppName'),
57
+                $c->query('Request'),
58
+                $c->query('UserManager'),
59
+                $c->query('GroupManager'),
60
+                $c->query('AvatarManager'),
61
+                $c->query('Logger'),
62
+                $c->query('L10N'),
63
+                $c->query('ServerContainer')->getURLGenerator(),
64
+                $c->query('UserId'),
65
+                $c->query('CommentMapper'),
66
+                $c->query('DateMapper'),
67
+                $c->query('EventMapper'),
68
+                $c->query('NotificationMapper'),
69
+                $c->query('ParticipationMapper'),
70
+                $c->query('ParticipationTextMapper'),
71
+                $c->query('TextMapper')
72
+            );
73
+        });
74
+
75
+        $container->registerService('UserManager', function ($c) {
76
+            /** @var SimpleContainer $c */
77
+            return $c->query('ServerContainer')->getUserManager();
78
+        });
79
+
80
+        $container->registerService('GroupManager', function ($c) {
81
+            /** @var SimpleContainer $c */
82
+            return $c->query('ServerContainer')->getGroupManager();
83
+        });
84
+
85
+        $container->registerService('AvatarManager', function ($c) {
86
+            /** @var SimpleContainer $c */
87
+            return $c->query('ServerContainer')->getAvatarManager();
88
+        });
89
+
90
+        $container->registerService('Logger', function ($c) {
91
+            /** @var SimpleContainer $c */
92
+            return $c->query('ServerContainer')->getLogger();
93
+        });
94
+
95
+        $container->registerService('L10N', function ($c) {
96
+            return $c->query('ServerContainer')->getL10N($c->query('AppName'));
97
+        });
98
+
99
+        $container->registerService('CommentMapper', function ($c) use ($server) {
100
+            /** @var SimpleContainer $c */
101
+            return new CommentMapper(
102
+                $server->getDatabaseConnection()
103
+            );
104
+        });
105
+
106
+        $container->registerService('DateMapper', function ($c) use ($server) {
107
+            /** @var SimpleContainer $c */
108
+            return new DateMapper(
109
+                $server->getDatabaseConnection()
110
+            );
111
+        });
112
+
113
+        $container->registerService('EventMapper', function ($c) use ($server) {
114
+            /** @var SimpleContainer $c */
115
+            return new EventMapper(
116
+                $server->getDatabaseConnection()
117
+            );
118
+        });
119
+
120
+        $container->registerService('NotificationMapper', function ($c) use ($server) {
121
+            /** @var SimpleContainer $c */
122
+            return new NotificationMapper(
123
+                $server->getDatabaseConnection()
124
+            );
125
+        });
126
+
127
+        $container->registerService('ParticipationMapper', function ($c) use ($server) {
128
+            /** @var SimpleContainer $c */
129
+            return new ParticipationMapper(
130
+                $server->getDatabaseConnection()
131
+            );
132
+        });
133
+
134
+        $container->registerService('ParticipationTextMapper', function ($c) use ($server) {
135
+            /** @var SimpleContainer $c */
136
+            return new ParticipationTextMapper(
137
+                $server->getDatabaseConnection()
138
+            );
139
+        });
140
+
141
+        $container->registerService('TextMapper', function ($c) use ($server) {
142
+            /** @var SimpleContainer $c */
143
+            return new TextMapper(
144
+                $server->getDatabaseConnection()
145
+            );
146
+        });
147
+    }
148
+
149
+    /**
150
+     * Register navigation entry for main navigation.
151
+     */
152
+    public function registerNavigationEntry() {
153
+        $container = $this->getContainer();
154
+        $container->query('OCP\INavigationManager')->add(function () use ($container) {
155
+            $urlGenerator = $container->query('OCP\IURLGenerator');
156
+            $l10n = $container->query('OCP\IL10N');
157
+            return [
158
+                'id' => 'polls',
159
+                'order' => 77,
160
+                'href' => $urlGenerator->linkToRoute('polls.page.index'),
161
+                'icon' => $urlGenerator->imagePath('polls', 'app.svg'),
162
+                'name' => $l10n->t('Polls')
163
+            ];
164
+        });
165
+    }
166 166
 }
Please login to merge, or discard this patch.