@@ -33,65 +33,65 @@ |
||
33 | 33 | |
34 | 34 | class CommentMapperTest extends UnitTestCase { |
35 | 35 | |
36 | - /** @var IDBConnection */ |
|
37 | - private $con; |
|
38 | - /** @var CommentMapper */ |
|
39 | - private $commentMapper; |
|
40 | - /** @var EventMapper */ |
|
41 | - private $eventMapper; |
|
36 | + /** @var IDBConnection */ |
|
37 | + private $con; |
|
38 | + /** @var CommentMapper */ |
|
39 | + private $commentMapper; |
|
40 | + /** @var EventMapper */ |
|
41 | + private $eventMapper; |
|
42 | 42 | |
43 | - /** |
|
44 | - * {@inheritDoc} |
|
45 | - */ |
|
46 | - public function setUp() { |
|
47 | - parent::setUp(); |
|
48 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
49 | - $this->commentMapper = new CommentMapper($this->con); |
|
50 | - $this->eventMapper = new EventMapper($this->con); |
|
51 | - } |
|
43 | + /** |
|
44 | + * {@inheritDoc} |
|
45 | + */ |
|
46 | + public function setUp() { |
|
47 | + parent::setUp(); |
|
48 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
49 | + $this->commentMapper = new CommentMapper($this->con); |
|
50 | + $this->eventMapper = new EventMapper($this->con); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * Test the creation of an event and a comment object and save them to the database. |
|
55 | - * |
|
56 | - * @return Comment |
|
57 | - */ |
|
58 | - public function testCreate() { |
|
59 | - /** @var Event $event */ |
|
60 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
61 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
53 | + /** |
|
54 | + * Test the creation of an event and a comment object and save them to the database. |
|
55 | + * |
|
56 | + * @return Comment |
|
57 | + */ |
|
58 | + public function testCreate() { |
|
59 | + /** @var Event $event */ |
|
60 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
61 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
62 | 62 | |
63 | - /** @var Comment $comment */ |
|
64 | - $comment = $this->fm->instance('OCA\Polls\Db\Comment'); |
|
65 | - $comment->setPollId($event->getId()); |
|
66 | - $this->assertInstanceOf(Comment::class, $this->commentMapper->insert($comment)); |
|
63 | + /** @var Comment $comment */ |
|
64 | + $comment = $this->fm->instance('OCA\Polls\Db\Comment'); |
|
65 | + $comment->setPollId($event->getId()); |
|
66 | + $this->assertInstanceOf(Comment::class, $this->commentMapper->insert($comment)); |
|
67 | 67 | |
68 | - return $comment; |
|
69 | - } |
|
68 | + return $comment; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * Update the previously created comment. |
|
73 | - * |
|
74 | - * @depends testCreate |
|
75 | - * @param Comment $comment |
|
76 | - * @return Comment |
|
77 | - */ |
|
78 | - public function testUpdate(Comment $comment) { |
|
79 | - $newComment = Faker::paragraph(); |
|
80 | - $comment->setComment($newComment()); |
|
81 | - $this->commentMapper->update($comment); |
|
71 | + /** |
|
72 | + * Update the previously created comment. |
|
73 | + * |
|
74 | + * @depends testCreate |
|
75 | + * @param Comment $comment |
|
76 | + * @return Comment |
|
77 | + */ |
|
78 | + public function testUpdate(Comment $comment) { |
|
79 | + $newComment = Faker::paragraph(); |
|
80 | + $comment->setComment($newComment()); |
|
81 | + $this->commentMapper->update($comment); |
|
82 | 82 | |
83 | - return $comment; |
|
84 | - } |
|
83 | + return $comment; |
|
84 | + } |
|
85 | 85 | |
86 | - /** |
|
87 | - * Delete the previously created entries from the database. |
|
88 | - * |
|
89 | - * @depends testUpdate |
|
90 | - * @param Comment $comment |
|
91 | - */ |
|
92 | - public function testDelete(Comment $comment) { |
|
93 | - $event = $this->eventMapper->find($comment->getPollId()); |
|
94 | - $this->commentMapper->delete($comment); |
|
95 | - $this->eventMapper->delete($event); |
|
96 | - } |
|
86 | + /** |
|
87 | + * Delete the previously created entries from the database. |
|
88 | + * |
|
89 | + * @depends testUpdate |
|
90 | + * @param Comment $comment |
|
91 | + */ |
|
92 | + public function testDelete(Comment $comment) { |
|
93 | + $event = $this->eventMapper->find($comment->getPollId()); |
|
94 | + $this->commentMapper->delete($comment); |
|
95 | + $this->eventMapper->delete($event); |
|
96 | + } |
|
97 | 97 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | |
32 | 32 | class NotificationMapperTest extends UnitTestCase { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $con; |
|
36 | - /** @var NotificationMapper */ |
|
37 | - private $notificationMapper; |
|
38 | - /** @var EventMapper */ |
|
39 | - private $eventMapper; |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $con; |
|
36 | + /** @var NotificationMapper */ |
|
37 | + private $notificationMapper; |
|
38 | + /** @var EventMapper */ |
|
39 | + private $eventMapper; |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inheritDoc} |
|
43 | - */ |
|
44 | - public function setUp() { |
|
45 | - parent::setUp(); |
|
46 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | - $this->notificationMapper = new NotificationMapper($this->con); |
|
48 | - $this->eventMapper = new EventMapper($this->con); |
|
49 | - } |
|
41 | + /** |
|
42 | + * {@inheritDoc} |
|
43 | + */ |
|
44 | + public function setUp() { |
|
45 | + parent::setUp(); |
|
46 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | + $this->notificationMapper = new NotificationMapper($this->con); |
|
48 | + $this->eventMapper = new EventMapper($this->con); |
|
49 | + } |
|
50 | 50 | |
51 | - public function testCreate() { |
|
52 | - /** @var Event $event */ |
|
53 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | - } |
|
51 | + public function testCreate() { |
|
52 | + /** @var Event $event */ |
|
53 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @depends testCreate |
|
59 | - */ |
|
60 | - public function testUpdate() { |
|
57 | + /** |
|
58 | + * @depends testCreate |
|
59 | + */ |
|
60 | + public function testUpdate() { |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @depends testDelete |
|
66 | - */ |
|
67 | - public function testDelete() { |
|
64 | + /** |
|
65 | + * @depends testDelete |
|
66 | + */ |
|
67 | + public function testDelete() { |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | |
32 | 32 | class ParticipationTextMapperTest extends UnitTestCase { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $con; |
|
36 | - /** @var ParticipationTextMapper */ |
|
37 | - private $participationTextMapper; |
|
38 | - /** @var EventMapper */ |
|
39 | - private $eventMapper; |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $con; |
|
36 | + /** @var ParticipationTextMapper */ |
|
37 | + private $participationTextMapper; |
|
38 | + /** @var EventMapper */ |
|
39 | + private $eventMapper; |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inheritDoc} |
|
43 | - */ |
|
44 | - public function setUp() { |
|
45 | - parent::setUp(); |
|
46 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | - $this->participationTextMapper = new ParticipationTextMapper($this->con); |
|
48 | - $this->eventMapper = new EventMapper($this->con); |
|
49 | - } |
|
41 | + /** |
|
42 | + * {@inheritDoc} |
|
43 | + */ |
|
44 | + public function setUp() { |
|
45 | + parent::setUp(); |
|
46 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | + $this->participationTextMapper = new ParticipationTextMapper($this->con); |
|
48 | + $this->eventMapper = new EventMapper($this->con); |
|
49 | + } |
|
50 | 50 | |
51 | - public function testCreate() { |
|
52 | - /** @var Event $event */ |
|
53 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | - } |
|
51 | + public function testCreate() { |
|
52 | + /** @var Event $event */ |
|
53 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @depends testCreate |
|
59 | - */ |
|
60 | - public function testUpdate() { |
|
57 | + /** |
|
58 | + * @depends testCreate |
|
59 | + */ |
|
60 | + public function testUpdate() { |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @depends testDelete |
|
66 | - */ |
|
67 | - public function testDelete() { |
|
64 | + /** |
|
65 | + * @depends testDelete |
|
66 | + */ |
|
67 | + public function testDelete() { |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | } |
@@ -30,37 +30,37 @@ |
||
30 | 30 | |
31 | 31 | class EventMapperTest extends UnitTestCase { |
32 | 32 | |
33 | - /** @var IDBConnection */ |
|
34 | - private $con; |
|
35 | - /** @var EventMapper */ |
|
36 | - private $eventMapper; |
|
33 | + /** @var IDBConnection */ |
|
34 | + private $con; |
|
35 | + /** @var EventMapper */ |
|
36 | + private $eventMapper; |
|
37 | 37 | |
38 | - /** |
|
39 | - * {@inheritDoc} |
|
40 | - */ |
|
41 | - public function setUp() { |
|
42 | - parent::setUp(); |
|
43 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
44 | - $this->eventMapper = new EventMapper($this->con); |
|
45 | - } |
|
38 | + /** |
|
39 | + * {@inheritDoc} |
|
40 | + */ |
|
41 | + public function setUp() { |
|
42 | + parent::setUp(); |
|
43 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
44 | + $this->eventMapper = new EventMapper($this->con); |
|
45 | + } |
|
46 | 46 | |
47 | - public function testCreate() { |
|
48 | - /** @var Event $event */ |
|
49 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
50 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
51 | - } |
|
47 | + public function testCreate() { |
|
48 | + /** @var Event $event */ |
|
49 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
50 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @depends testCreate |
|
55 | - */ |
|
56 | - public function testUpdate() { |
|
53 | + /** |
|
54 | + * @depends testCreate |
|
55 | + */ |
|
56 | + public function testUpdate() { |
|
57 | 57 | |
58 | - } |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @depends testDelete |
|
62 | - */ |
|
63 | - public function testDelete() { |
|
60 | + /** |
|
61 | + * @depends testDelete |
|
62 | + */ |
|
63 | + public function testDelete() { |
|
64 | 64 | |
65 | - } |
|
65 | + } |
|
66 | 66 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | |
32 | 32 | class DateMapperTest extends UnitTestCase { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $con; |
|
36 | - /** @var DateMapper */ |
|
37 | - private $dateMapper; |
|
38 | - /** @var EventMapper */ |
|
39 | - private $eventMapper; |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $con; |
|
36 | + /** @var DateMapper */ |
|
37 | + private $dateMapper; |
|
38 | + /** @var EventMapper */ |
|
39 | + private $eventMapper; |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inheritDoc} |
|
43 | - */ |
|
44 | - public function setUp() { |
|
45 | - parent::setUp(); |
|
46 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | - $this->dateMapper = new DateMapper($this->con); |
|
48 | - $this->eventMapper = new EventMapper($this->con); |
|
49 | - } |
|
41 | + /** |
|
42 | + * {@inheritDoc} |
|
43 | + */ |
|
44 | + public function setUp() { |
|
45 | + parent::setUp(); |
|
46 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | + $this->dateMapper = new DateMapper($this->con); |
|
48 | + $this->eventMapper = new EventMapper($this->con); |
|
49 | + } |
|
50 | 50 | |
51 | - public function testCreate() { |
|
52 | - /** @var Event $event */ |
|
53 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | - } |
|
51 | + public function testCreate() { |
|
52 | + /** @var Event $event */ |
|
53 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @depends testCreate |
|
59 | - */ |
|
60 | - public function testUpdate() { |
|
57 | + /** |
|
58 | + * @depends testCreate |
|
59 | + */ |
|
60 | + public function testUpdate() { |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @depends testDelete |
|
66 | - */ |
|
67 | - public function testDelete() { |
|
64 | + /** |
|
65 | + * @depends testDelete |
|
66 | + */ |
|
67 | + public function testDelete() { |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | |
32 | 32 | class ParticipationMapperTest extends UnitTestCase { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $con; |
|
36 | - /** @var ParticipationMapper */ |
|
37 | - private $participationMapper; |
|
38 | - /** @var EventMapper */ |
|
39 | - private $eventMapper; |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $con; |
|
36 | + /** @var ParticipationMapper */ |
|
37 | + private $participationMapper; |
|
38 | + /** @var EventMapper */ |
|
39 | + private $eventMapper; |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inheritDoc} |
|
43 | - */ |
|
44 | - public function setUp() { |
|
45 | - parent::setUp(); |
|
46 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | - $this->participationMapper = new ParticipationMapper($this->con); |
|
48 | - $this->eventMapper = new EventMapper($this->con); |
|
49 | - } |
|
41 | + /** |
|
42 | + * {@inheritDoc} |
|
43 | + */ |
|
44 | + public function setUp() { |
|
45 | + parent::setUp(); |
|
46 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | + $this->participationMapper = new ParticipationMapper($this->con); |
|
48 | + $this->eventMapper = new EventMapper($this->con); |
|
49 | + } |
|
50 | 50 | |
51 | - public function testCreate() { |
|
52 | - /** @var Event $event */ |
|
53 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | - } |
|
51 | + public function testCreate() { |
|
52 | + /** @var Event $event */ |
|
53 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @depends testCreate |
|
59 | - */ |
|
60 | - public function testUpdate() { |
|
57 | + /** |
|
58 | + * @depends testCreate |
|
59 | + */ |
|
60 | + public function testUpdate() { |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @depends testDelete |
|
66 | - */ |
|
67 | - public function testDelete() { |
|
64 | + /** |
|
65 | + * @depends testDelete |
|
66 | + */ |
|
67 | + public function testDelete() { |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | |
32 | 32 | class TextMapperTest extends UnitTestCase { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $con; |
|
36 | - /** @var TextMapper */ |
|
37 | - private $textMapper; |
|
38 | - /** @var EventMapper */ |
|
39 | - private $eventMapper; |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $con; |
|
36 | + /** @var TextMapper */ |
|
37 | + private $textMapper; |
|
38 | + /** @var EventMapper */ |
|
39 | + private $eventMapper; |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inheritDoc} |
|
43 | - */ |
|
44 | - public function setUp() { |
|
45 | - parent::setUp(); |
|
46 | - $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | - $this->textMapper = new TextMapper($this->con); |
|
48 | - $this->eventMapper = new EventMapper($this->con); |
|
49 | - } |
|
41 | + /** |
|
42 | + * {@inheritDoc} |
|
43 | + */ |
|
44 | + public function setUp() { |
|
45 | + parent::setUp(); |
|
46 | + $this->con = \OC::$server->getDatabaseConnection(); |
|
47 | + $this->textMapper = new TextMapper($this->con); |
|
48 | + $this->eventMapper = new EventMapper($this->con); |
|
49 | + } |
|
50 | 50 | |
51 | - public function testCreate() { |
|
52 | - /** @var Event $event */ |
|
53 | - $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | - $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | - } |
|
51 | + public function testCreate() { |
|
52 | + /** @var Event $event */ |
|
53 | + $event = $this->fm->instance('OCA\Polls\Db\Event'); |
|
54 | + $this->assertInstanceOf(Event::class, $this->eventMapper->insert($event)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @depends testCreate |
|
59 | - */ |
|
60 | - public function testUpdate() { |
|
57 | + /** |
|
58 | + * @depends testCreate |
|
59 | + */ |
|
60 | + public function testUpdate() { |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @depends testDelete |
|
66 | - */ |
|
67 | - public function testDelete() { |
|
64 | + /** |
|
65 | + * @depends testDelete |
|
66 | + */ |
|
67 | + public function testDelete() { |
|
68 | 68 | |
69 | - } |
|
69 | + } |
|
70 | 70 | } |