@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param string $filename |
33 | 33 | * @return bool |
34 | 34 | */ |
35 | -function fopen($filename) |
|
35 | +function fopen ($filename) |
|
36 | 36 | { |
37 | 37 | return strpos($filename, 'readable') !== false; |
38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return bool|mixed |
44 | 44 | */ |
45 | -function fgets() |
|
45 | +function fgets () |
|
46 | 46 | { |
47 | 47 | if (empty(ImportTwineTest::$fgetsStack)) { |
48 | 48 | return false; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param Resource $handle |
58 | 58 | * @param string $string |
59 | 59 | */ |
60 | -function fputs($handle, $string) |
|
60 | +function fputs ($handle, $string) |
|
61 | 61 | { |
62 | 62 | ImportTwineTest::$fputsStack[] = $string; |
63 | 63 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * mock function |
67 | 67 | */ |
68 | -function fclose() |
|
68 | +function fclose () |
|
69 | 69 | { |
70 | 70 | } |
71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return bool|mixed |
76 | 76 | */ |
77 | -function fread() |
|
77 | +function fread () |
|
78 | 78 | { |
79 | 79 | if (empty(ImportTwineTest::$freadStack)) { |
80 | 80 | return false; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @return bool |
90 | 90 | */ |
91 | -function feof() |
|
91 | +function feof () |
|
92 | 92 | { |
93 | 93 | return empty(ImportTwineTest::$freadStack); |
94 | 94 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @return int |
100 | 100 | */ |
101 | -function fseek() |
|
101 | +function fseek () |
|
102 | 102 | { |
103 | 103 | return 0; |
104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | /** |
107 | 107 | * @param Resource $parser |
108 | 108 | */ |
109 | -function xml_parser_free($parser) |
|
109 | +function xml_parser_free ($parser) |
|
110 | 110 | { |
111 | 111 | ImportTwineTest::$parserFreeCalled = true; |
112 | 112 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** |
143 | 143 | * resets some variables |
144 | 144 | */ |
145 | - public function setUp() |
|
145 | + public function setUp () |
|
146 | 146 | { |
147 | 147 | self::$freadStack = self::$fgetsStack = self::$fputsStack = []; |
148 | 148 | $this->mocks = []; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @expectedException Exception |
154 | 154 | * @expectedExceptionMessage Failed to read data from file 'somefilename' |
155 | 155 | */ |
156 | - public function testRunWithFopenIsFalse() |
|
156 | + public function testRunWithFopenIsFalse () |
|
157 | 157 | { |
158 | 158 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
159 | 159 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @expectedException Exception |
169 | 169 | * @expectedExceptionMessage Failed to read data from file 'somefilename_readable' |
170 | 170 | */ |
171 | - public function testRunWithFreadReturnFalse() |
|
171 | + public function testRunWithFreadReturnFalse () |
|
172 | 172 | { |
173 | 173 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
174 | 174 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @expectedException Exception |
188 | 188 | * @expectedExceptionMessage File 'somefilename_readable' isn't a Twine archive file |
189 | 189 | */ |
190 | - public function testRunWithWrongFileFormat() |
|
190 | + public function testRunWithWrongFileFormat () |
|
191 | 191 | { |
192 | 192 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
193 | 193 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @expectedException Exception |
210 | 210 | * @expectedExceptionMessage File 'somefilename_readable' seems to be empty. |
211 | 211 | */ |
212 | - public function testRunWithEmptyFirstLine() |
|
212 | + public function testRunWithEmptyFirstLine () |
|
213 | 213 | { |
214 | 214 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
215 | 215 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * |
233 | 233 | * @throws \Exception |
234 | 234 | */ |
235 | - public function testRunWithCorrectButIncompleteData() |
|
235 | + public function testRunWithCorrectButIncompleteData () |
|
236 | 236 | { |
237 | 237 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
238 | 238 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @throws \Exception |
258 | 258 | */ |
259 | - public function testRunButNoTextnodeIsWritten() |
|
259 | + public function testRunButNoTextnodeIsWritten () |
|
260 | 260 | { |
261 | 261 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
262 | 262 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | |
266 | 266 | self::$freadStack = [ |
267 | 267 | '<tw-storydata ', |
268 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
269 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
268 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
269 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
270 | 270 | '<tw-passagedata pid="1" name="someNodeName" tags="Freigegeben ID:foobar" position="104,30">lorem impsum', |
271 | 271 | 'lorem impsum</tw-passagedata></tw-storydata>', |
272 | 272 | ]; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * |
302 | 302 | * @throws \Exception |
303 | 303 | */ |
304 | - public function testRunWithSingleNodeWithText() |
|
304 | + public function testRunWithSingleNodeWithText () |
|
305 | 305 | { |
306 | 306 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
307 | 307 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | |
311 | 311 | self::$freadStack = [ |
312 | 312 | '<tw-storydata ', |
313 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
314 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
313 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
314 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
315 | 315 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
316 | 316 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
317 | 317 | ]; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | $textnodeRepository->expects($this->once()) |
332 | 332 | ->method('save') |
333 | - ->with($this->callback(function ($textnode) { |
|
333 | + ->with($this->callback(function($textnode) { |
|
334 | 334 | return $textnode instanceof Textnode |
335 | 335 | && $textnode->getText() === "lorem ipsumlorem ipsum"; |
336 | 336 | })); |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @expectedException Exception |
347 | 347 | * @expectedExceptionMessage The Twine archive file 'somefilename_readable' has a textnode named 'someNodeName1' which contains a malformed link that starts with '[[' but has no corresponding ']]'. |
348 | 348 | */ |
349 | - public function testRunWithUnfinishedLinkTag() |
|
349 | + public function testRunWithUnfinishedLinkTag () |
|
350 | 350 | { |
351 | 351 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
352 | 352 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | |
356 | 356 | self::$freadStack = [ |
357 | 357 | '<tw-storydata ', |
358 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
359 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
358 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
359 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
360 | 360 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
361 | 361 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
362 | 362 | ]; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | $textnodeRepository->expects($this->any()) |
378 | 378 | ->method('save') |
379 | - ->with($this->callback(function ($textnode) { |
|
379 | + ->with($this->callback(function($textnode) { |
|
380 | 380 | return $textnode instanceof Textnode |
381 | 381 | && $textnode->getText() === "lorem ipsumlorem ipsum"; |
382 | 382 | })); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | * @expectedException Exception |
395 | 395 | * @expectedExceptionMessage no licensee available |
396 | 396 | */ |
397 | - public function testRunWithExceptionWhenNoLicenseeIsAvailable() |
|
397 | + public function testRunWithExceptionWhenNoLicenseeIsAvailable () |
|
398 | 398 | { |
399 | 399 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
400 | 400 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @expectedException Exception |
412 | 412 | * @expectedExceptionMessage no filename available |
413 | 413 | */ |
414 | - public function testRunWithExceptionWhenNoFilenameIsAvailable() |
|
414 | + public function testRunWithExceptionWhenNoFilenameIsAvailable () |
|
415 | 415 | { |
416 | 416 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
417 | 417 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * @expectedException Exception |
427 | 427 | * @expectedExceptionMessage no ID given for Textnode "someNodeName1" |
428 | 428 | */ |
429 | - public function testRunWithTextnodeWithoutTwineID() |
|
429 | + public function testRunWithTextnodeWithoutTwineID () |
|
430 | 430 | { |
431 | 431 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
432 | 432 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -435,8 +435,8 @@ discard block |
||
435 | 435 | |
436 | 436 | self::$freadStack = [ |
437 | 437 | '<tw-storydata ', |
438 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
439 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
438 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
439 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
440 | 440 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben" position="104,30">lorem ipsum', |
441 | 441 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
442 | 442 | ]; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * @expectedException Exception |
465 | 465 | * @expectedExceptionMessage no ID given for Textnode "someNodeName1" |
466 | 466 | */ |
467 | - public function testRunWithTextnodeWithoutAnyTag() |
|
467 | + public function testRunWithTextnodeWithoutAnyTag () |
|
468 | 468 | { |
469 | 469 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
470 | 470 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -473,8 +473,8 @@ discard block |
||
473 | 473 | |
474 | 474 | self::$freadStack = [ |
475 | 475 | '<tw-storydata ', |
476 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
477 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
476 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
477 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
478 | 478 | '<tw-passagedata pid="1" name="someNodeName1" tags="" position="104,30">lorem ipsum', |
479 | 479 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
480 | 480 | ]; |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * tests identifying a textnode by a twine ID |
503 | 503 | * @throws \Exception |
504 | 504 | */ |
505 | - public function testRunWithTextnodeWithTwineID() |
|
505 | + public function testRunWithTextnodeWithTwineID () |
|
506 | 506 | { |
507 | 507 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
508 | 508 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | |
512 | 512 | self::$freadStack = [ |
513 | 513 | '<tw-storydata ', |
514 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
515 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
514 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
515 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
516 | 516 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
517 | 517 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
518 | 518 | ]; |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * tests the freeing of xml parser |
542 | 542 | * @throws \Exception |
543 | 543 | */ |
544 | - public function testParserFree() |
|
544 | + public function testParserFree () |
|
545 | 545 | { |
546 | 546 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
547 | 547 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -550,8 +550,8 @@ discard block |
||
550 | 550 | |
551 | 551 | self::$freadStack = [ |
552 | 552 | '<tw-storydata ', |
553 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
554 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
553 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
554 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
555 | 555 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
556 | 556 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
557 | 557 | ]; |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | * tests disabling of a textnode that is no longer found in import file |
583 | 583 | * @throws \Exception |
584 | 584 | */ |
585 | - public function testRunWithTextnodeDeletedInImportfile() |
|
585 | + public function testRunWithTextnodeDeletedInImportfile () |
|
586 | 586 | { |
587 | 587 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
588 | 588 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -591,8 +591,8 @@ discard block |
||
591 | 591 | |
592 | 592 | self::$freadStack = [ |
593 | 593 | '<tw-storydata ', |
594 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
595 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
594 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
595 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
596 | 596 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
597 | 597 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
598 | 598 | ]; |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @expectedException Exception |
628 | 628 | * @expectedExceptionMessage There is a 'tw-passagedata' in the Twine archive file 'somefilename_readable' which has a non unique 'id' tag [someTwineId], in node 'someNodeName2' |
629 | 629 | */ |
630 | - public function testRunWithDuplicateTwineId() |
|
630 | + public function testRunWithDuplicateTwineId () |
|
631 | 631 | { |
632 | 632 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
633 | 633 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -636,8 +636,8 @@ discard block |
||
636 | 636 | |
637 | 637 | self::$freadStack = [ |
638 | 638 | '<tw-storydata ', |
639 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
640 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
639 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
640 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
641 | 641 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId" position="104,30">lorem ipsum', |
642 | 642 | 'lorem ipsum</tw-passagedata>', |
643 | 643 | '<tw-passagedata pid="2" name="someNodeName2" tags="ID:someTwineId" position="104,30">lorem ipsum', |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | * @expectedException Exception |
669 | 669 | * @expectedExceptionMessage There is a textnode which references another textnode named 'someNodeName3', but this textnode doesn't exist within the same story. |
670 | 670 | */ |
671 | - public function testRunWithLinkToNonExistingTextnode() |
|
671 | + public function testRunWithLinkToNonExistingTextnode () |
|
672 | 672 | { |
673 | 673 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
674 | 674 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -677,8 +677,8 @@ discard block |
||
677 | 677 | |
678 | 678 | self::$freadStack = [ |
679 | 679 | '<tw-storydata ', |
680 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
681 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
680 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
681 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
682 | 682 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId1" position="104,30">lorem ipsum', |
683 | 683 | 'lorem ipsum [[Linkdata->someNodeName3]]</tw-passagedata>', |
684 | 684 | '</tw-storydata>', |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | * tests a hitch to another textnode |
709 | 709 | * @throws \Exception |
710 | 710 | */ |
711 | - public function testRunWithLinkToAnotherTextnode() |
|
711 | + public function testRunWithLinkToAnotherTextnode () |
|
712 | 712 | { |
713 | 713 | $textnodeRepository = $this->getTextnodeRepositoryMock(); |
714 | 714 | $topicRepository = $this->getTopicRepositoryMock(); |
@@ -717,8 +717,8 @@ discard block |
||
717 | 717 | |
718 | 718 | self::$freadStack = [ |
719 | 719 | '<tw-storydata ', |
720 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
721 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
720 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
721 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
722 | 722 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId1" position="104,30">lorem ipsum', |
723 | 723 | 'lorem ipsum [[Linkdata->someNodeName2]]</tw-passagedata>', |
724 | 724 | '<tw-passagedata pid="2" name="someNodeName2" tags="ID:someTwineId2" position="104,30">lorem ipsum', |
@@ -745,9 +745,9 @@ discard block |
||
745 | 745 | |
746 | 746 | $textnodeRepository->expects($this->any()) |
747 | 747 | ->method('save') |
748 | - ->willReturnCallback(function ($textnode) { |
|
748 | + ->willReturnCallback(function($textnode) { |
|
749 | 749 | static $counter = 0; |
750 | - $textnode->setId('someTextnode'.$counter++); |
|
750 | + $textnode->setId('someTextnode' . $counter++); |
|
751 | 751 | }); |
752 | 752 | |
753 | 753 | $importTwine = new ImportTwine($textnodeRepository, $topicRepository); |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $this->assertTrue($returnValue); |
757 | 757 | } |
758 | 758 | |
759 | - private function getDummyImportfile(array $data = []) |
|
759 | + private function getDummyImportfile (array $data = []) |
|
760 | 760 | { |
761 | 761 | $default = [ |
762 | 762 | 'filename' => 'somefilename_readable', |
@@ -789,17 +789,17 @@ discard block |
||
789 | 789 | return $importfile; |
790 | 790 | } |
791 | 791 | |
792 | - private function getTextnodeRepositoryMock() |
|
792 | + private function getTextnodeRepositoryMock () |
|
793 | 793 | { |
794 | 794 | return $this->getMockBuilder(TextNodeRepository::class)->disableOriginalConstructor()->setMethods(['createQueryBuilder', 'field', 'equals', 'getQuery', 'save', 'find', 'findByTwineId', 'disableOrphanedNodes', 'setHyphenatedText'])->getMock(); |
795 | 795 | } |
796 | 796 | |
797 | - private function getTopicRepositoryMock() |
|
797 | + private function getTopicRepositoryMock () |
|
798 | 798 | { |
799 | 799 | return $this->getMockBuilder(TopicRepository::class)->disableOriginalConstructor()->setMethods(['find'])->getMock(); |
800 | 800 | } |
801 | 801 | |
802 | - private function getDmMock() |
|
802 | + private function getDmMock () |
|
803 | 803 | { |
804 | 804 | return $this->getMockBuilder('dmMock')->setMethods(['flush', 'persist', 'find'])->getMock(); |
805 | 805 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * tests the index action |
58 | 58 | */ |
59 | - public function testIndexAction() |
|
59 | + public function testIndexAction () |
|
60 | 60 | { |
61 | 61 | $client = static::createClient(); |
62 | 62 | $crawler = $client->request('GET', '/admin/'); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * tests controller's userAction with no users in db |
70 | 70 | */ |
71 | - public function testUserAction() |
|
71 | + public function testUserAction () |
|
72 | 72 | { |
73 | 73 | $request = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); |
74 | 74 | $postMock = $this->getMockBuilder(ParameterBag::class)->disableOriginalConstructor()->getMock(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * tests controller's userAction with two users in db |
107 | 107 | */ |
108 | - public function testUserActionWithUsers() |
|
108 | + public function testUserActionWithUsers () |
|
109 | 109 | { |
110 | 110 | $request = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); |
111 | 111 | $postMock = $this->getMockBuilder(ParameterBag::class)->disableOriginalConstructor()->getMock(); |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | /* @var $response \Symfony\Component\HttpFoundation\Response */ |
153 | 153 | $response = $controller->usersAction($request); |
154 | 154 | $this->assertInstanceOf(Response::class, $response); |
155 | - $this->assertJsonStringEqualsJsonString('[{"id":"id1","gender":null,"email":"email1","roles":"ROLE_ADMIN","licenseeId":"lic1","status":null,"source":null,"reason":null,"created":"'.date('Y-m-d H:i:s', 0).'","updated":"'.date('Y-m-d H:i:s', 0).'"},{"id":"id2","email":"email2","roles":"ROLE_USER","licenseeId":"lic2","status":null,"source":null,"reason":null,"gender":null,"created":"'.date('Y-m-d H:i:s', 0).'","updated":"'.date('Y-m-d H:i:s', 0).'"}]', $response->getContent()); |
|
155 | + $this->assertJsonStringEqualsJsonString('[{"id":"id1","gender":null,"email":"email1","roles":"ROLE_ADMIN","licenseeId":"lic1","status":null,"source":null,"reason":null,"created":"' . date('Y-m-d H:i:s', 0) . '","updated":"' . date('Y-m-d H:i:s', 0) . '"},{"id":"id2","email":"email2","roles":"ROLE_USER","licenseeId":"lic2","status":null,"source":null,"reason":null,"gender":null,"created":"' . date('Y-m-d H:i:s', 0) . '","updated":"' . date('Y-m-d H:i:s', 0) . '"}]', $response->getContent()); |
|
156 | 156 | $this->assertEquals('200', $response->getStatusCode()); |
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * tear down method |
161 | 161 | */ |
162 | - public function tearDown() |
|
162 | + public function tearDown () |
|
163 | 163 | { |
164 | 164 | $this->container = null; |
165 | 165 | $this->repository = null; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * tests the formsaveAction without parameters |
171 | 171 | */ |
172 | - public function testFormsaveActionWithoutParameters() |
|
172 | + public function testFormsaveActionWithoutParameters () |
|
173 | 173 | { |
174 | 174 | $request = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); |
175 | 175 | $postMock = $this->getMockBuilder(ParameterBag::class)->disableOriginalConstructor()->getMock(); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | /** |
195 | 195 | * tests the formsaveAction with wrong parameters |
196 | 196 | */ |
197 | - public function testFormsaveActionWithWrongParameters() |
|
197 | + public function testFormsaveActionWithWrongParameters () |
|
198 | 198 | { |
199 | 199 | $request = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); |
200 | 200 | $postMock = $this->getMockBuilder(ParameterBag::class)->disableOriginalConstructor()->getMock(); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * tests the formsaveAction with an existing user |
223 | 223 | */ |
224 | - public function testFormsaveActionExistingUser() |
|
224 | + public function testFormsaveActionExistingUser () |
|
225 | 225 | { |
226 | 226 | $user = new User(); |
227 | 227 | $user->setId('someId'); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | /** |
262 | 262 | * tests the formsaveAction with a nonexisting user |
263 | 263 | */ |
264 | - public function testFormsaveActionNotExistingUser() |
|
264 | + public function testFormsaveActionNotExistingUser () |
|
265 | 265 | { |
266 | 266 | $user = new User(); |
267 | 267 | $user->setId('someId'); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | /** |
301 | 301 | * tests the formsaveAction without admin permission |
302 | 302 | */ |
303 | - public function testFormsaveActionWithoutAdminPermission() |
|
303 | + public function testFormsaveActionWithoutAdminPermission () |
|
304 | 304 | { |
305 | 305 | $client = static::createClient(); |
306 | 306 | $crawler = $client->request('GET', '/admin/save'); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | /** |
314 | 314 | * tests the formsaveAction with missing id parameter |
315 | 315 | */ |
316 | - public function testFormsaveActionWithMissingIdParameter() |
|
316 | + public function testFormsaveActionWithMissingIdParameter () |
|
317 | 317 | { |
318 | 318 | $request = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock(); |
319 | 319 | $postMock = $this->getMockBuilder(ParameterBag::class)->disableOriginalConstructor()->getMock(); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | /** |
342 | 342 | * tests licenseeAction with no licensees |
343 | 343 | */ |
344 | - public function testLicenseeActionWithNoLicensees() |
|
344 | + public function testLicenseeActionWithNoLicensees () |
|
345 | 345 | { |
346 | 346 | $repository = $this->getMockBuilder(LicenseeRepository::class)->disableOriginalConstructor()->setMethods(['findAll'])->getMock(); |
347 | 347 | $repository->expects($this->once()) |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | /** |
368 | 368 | * tests licenseeAction() with one licensee |
369 | 369 | */ |
370 | - public function testLicenseeActionWithOneLicensee() |
|
370 | + public function testLicenseeActionWithOneLicensee () |
|
371 | 371 | { |
372 | 372 | $licensee = new Licensee(); |
373 | 373 | $licensee->setName('someName'); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | /** |
398 | 398 | * tests textnode action |
399 | 399 | */ |
400 | - public function testTextnodesAction() |
|
400 | + public function testTextnodesAction () |
|
401 | 401 | { |
402 | 402 | $textnode = new Textnode(); |
403 | 403 | $textnode->setId('someId'); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $this->assertJsonStringEqualsJsonString($expectedJson, $response->getContent()); |
465 | 465 | } |
466 | 466 | |
467 | - private function getLicenseeRepositoryMock() |
|
467 | + private function getLicenseeRepositoryMock () |
|
468 | 468 | { |
469 | 469 | $repository = $this->getMockBuilder(LicenseeRepository::class) |
470 | 470 | ->disableOriginalConstructor() |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | return $repository; |
475 | 475 | } |
476 | 476 | |
477 | - private function getImportfileRepositoryMock() |
|
477 | + private function getImportfileRepositoryMock () |
|
478 | 478 | { |
479 | 479 | $repository = $this->getMockBuilder(ImportfileRepository::class) |
480 | 480 | ->disableOriginalConstructor() |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | /** |
488 | 488 | * load mockoed container and mocked mongodb repository |
489 | 489 | */ |
490 | - private function loadMongoContainer($repository) |
|
490 | + private function loadMongoContainer ($repository) |
|
491 | 491 | { |
492 | 492 | $this->loadMockedContainer(); |
493 | 493 | $this->loadMockedMongoRepository($repository); |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | /** |
497 | 497 | * load mocked container |
498 | 498 | */ |
499 | - private function loadMockedContainer() |
|
499 | + private function loadMockedContainer () |
|
500 | 500 | { |
501 | 501 | $this->container = $this->createMock(ContainerInterface::class); |
502 | 502 | } |
@@ -504,13 +504,13 @@ discard block |
||
504 | 504 | /** |
505 | 505 | * load mocked mongodb repository |
506 | 506 | */ |
507 | - private function loadMockedMongoRepository($repository) |
|
507 | + private function loadMockedMongoRepository ($repository) |
|
508 | 508 | { |
509 | 509 | $this->service = $this->getMockBuilder(ManagerRegistry::class)->disableOriginalConstructor()->getMock(); |
510 | 510 | $this->repository = $this->getMockBuilder(DocumentRepository::class)->disableOriginalConstructor()->getMock(); |
511 | 511 | $this->container->expects($this->once()) |
512 | 512 | ->method("get") |
513 | - ->with($this->equalTo('app.model_repository_'.$repository)) |
|
513 | + ->with($this->equalTo('app.model_repository_' . $repository)) |
|
514 | 514 | ->will($this->returnValue($this->repository)); |
515 | 515 | } |
516 | 516 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * tests topicAction() with no topics |
38 | 38 | */ |
39 | - public function testListActionWithNoTopics() |
|
39 | + public function testListActionWithNoTopics () |
|
40 | 40 | { |
41 | 41 | $container = $this->getMockBuilder(ContainerInterface::class)->getMock(); |
42 | 42 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * tests topicAction with one topic |
64 | 64 | */ |
65 | - public function testListActionWithOneTopic() |
|
65 | + public function testListActionWithOneTopic () |
|
66 | 66 | { |
67 | 67 | $topic = new Topic(); |
68 | 68 | $topic->setName('someName'); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * tests topicAction with some filters |
97 | 97 | */ |
98 | - public function testListActionWithSomeFilters() |
|
98 | + public function testListActionWithSomeFilters () |
|
99 | 99 | { |
100 | 100 | $topic = new Topic(); |
101 | 101 | $topic->setName('someName'); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /** |
137 | 137 | * tests uploadImageAction with an error in $_FILES |
138 | 138 | */ |
139 | - public function testUploadImageActionWithNoFileError() |
|
139 | + public function testUploadImageActionWithNoFileError () |
|
140 | 140 | { |
141 | 141 | $repository = $this->getMockBuilder(TopicRepository::class)->disableOriginalConstructor()->setMethods(['findBy'])->getMock(); |
142 | 142 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | /** |
161 | 161 | * tests uploadImageAction |
162 | 162 | */ |
163 | - public function testUploadImageActionWithNoError() |
|
163 | + public function testUploadImageActionWithNoError () |
|
164 | 164 | { |
165 | 165 | $repository = $this->getMockBuilder(TopicRepository::class)->disableOriginalConstructor()->setMethods(['findBy'])->getMock(); |
166 | 166 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | /** |
189 | 189 | * tear down method |
190 | 190 | */ |
191 | - public function tearDown() |
|
191 | + public function tearDown () |
|
192 | 192 | { |
193 | 193 | $this->container = null; |
194 | 194 | $this->repository = null; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param ContainerInterface $container |
45 | 45 | * @param TopicRepositoryInterface $topicRepository |
46 | 46 | */ |
47 | - public function __construct(ContainerInterface $container, TopicRepositoryInterface $topicRepository) |
|
47 | + public function __construct (ContainerInterface $container, TopicRepositoryInterface $topicRepository) |
|
48 | 48 | { |
49 | 49 | $this->container = $container; |
50 | 50 | $this->topicRepository = $topicRepository; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param Request $request |
57 | 57 | * @return Response |
58 | 58 | */ |
59 | - public function listAction(Request $request) |
|
59 | + public function listAction (Request $request) |
|
60 | 60 | { |
61 | 61 | $filters = $request->query->get('filter'); |
62 | 62 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return Response |
88 | 88 | */ |
89 | - public function uploadImageAction() |
|
89 | + public function uploadImageAction () |
|
90 | 90 | { |
91 | 91 | $output = array(); |
92 | 92 | $file = $_FILES['upload']; |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | return new Response(\json_encode($output)); |
97 | 97 | } |
98 | 98 | $directory = $this->getParameter('topic_image_directory'); |
99 | - $filename = md5(uniqid().$file['name']); |
|
100 | - move_uploaded_file($file["tmp_name"], $directory.$filename); |
|
99 | + $filename = md5(uniqid() . $file['name']); |
|
100 | + move_uploaded_file($file["tmp_name"], $directory . $filename); |
|
101 | 101 | $output['imageFileName'] = $filename; |
102 | 102 | $output['originalImageName'] = $file['name']; |
103 | 103 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /** |
62 | 62 | * configures the symfony cli command |
63 | 63 | */ |
64 | - protected function configure() |
|
64 | + protected function configure () |
|
65 | 65 | { |
66 | 66 | $this |
67 | 67 | ->setName('dembelo:import') |
@@ -91,20 +91,20 @@ discard block |
||
91 | 91 | ); |
92 | 92 | } |
93 | 93 | |
94 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
94 | + protected function execute (InputInterface $input, OutputInterface $output) |
|
95 | 95 | { |
96 | 96 | $importTwine = $this->getContainer()->get('admin.import.twine'); |
97 | 97 | $this->output = $output; |
98 | 98 | $this->prepare($input); |
99 | 99 | |
100 | 100 | if (file_exists($this->twineArchivePath) !== true) { |
101 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' doesn't exist.</error>"); |
|
101 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' doesn't exist.</error>"); |
|
102 | 102 | |
103 | 103 | return -1; |
104 | 104 | } |
105 | 105 | |
106 | 106 | if (is_readable($this->twineArchivePath) !== true) { |
107 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' isn't readable.</error>"); |
|
107 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' isn't readable.</error>"); |
|
108 | 108 | |
109 | 109 | return -1; |
110 | 110 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $this->dm->flush(); |
125 | 125 | } catch (\Exception $ex) { |
126 | - $output->writeln('<error>'.$ex->getMessage().'</error>'); |
|
126 | + $output->writeln('<error>' . $ex->getMessage() . '</error>'); |
|
127 | 127 | |
128 | 128 | $importTwine->parserFree(); |
129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | return 0; |
134 | 134 | } |
135 | 135 | |
136 | - private function prepare(InputInterface $input) |
|
136 | + private function prepare (InputInterface $input) |
|
137 | 137 | { |
138 | 138 | $styleWarning = new OutputFormatterStyle('black', 'yellow'); |
139 | 139 | $this->output->getFormatter()->setStyle('warning', $styleWarning); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | $licensee = $repositoryLicensee->findOneByName($input->getOption('licensee-name')); |
153 | 153 | if (is_null($licensee)) { |
154 | - throw new \Exception("<error>A Licensee named '".$input->getOption('licensee-name')."' doesn't exist.</error>"); |
|
154 | + throw new \Exception("<error>A Licensee named '" . $input->getOption('licensee-name') . "' doesn't exist.</error>"); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | $this->author = $input->getOption('metadata-author'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @inheritdoc |
48 | 48 | */ |
49 | - public function setUp() |
|
49 | + public function setUp () |
|
50 | 50 | { |
51 | 51 | parent::setUp(); // TODO: Change the autogenerated stub |
52 | 52 | $this->topic = new Topic(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * tests setting of a favorite via cookie |
66 | 66 | */ |
67 | - public function testSetFavoriteWithCookie() |
|
67 | + public function testSetFavoriteWithCookie () |
|
68 | 68 | { |
69 | 69 | $this->favMgr->setFavorite($this->textnode); |
70 | 70 | $this->assertEquals('textnodeId', $this->favMgr->getFavorite($this->topic)); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * tests setting of a favorite via user object |
76 | 76 | */ |
77 | - public function testSetFavoriteWithUser() |
|
77 | + public function testSetFavoriteWithUser () |
|
78 | 78 | { |
79 | 79 | $this->favMgr->setFavorite($this->textnode, $this->user); |
80 | 80 | $this->assertEquals('textnodeId', $this->favMgr->getFavorite($this->topic, $this->user)); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * tests setting of a favorite across multiple instances via user object |
86 | 86 | */ |
87 | - public function testSetFavoriteWithMultipleInstancesWithUser() |
|
87 | + public function testSetFavoriteWithMultipleInstancesWithUser () |
|
88 | 88 | { |
89 | 89 | $this->favMgr->setFavorite($this->textnode, $this->user); |
90 | 90 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | /** |
97 | 97 | * tests setting of a favorite across multiple instances via cookie |
98 | 98 | */ |
99 | - public function testSetFavoriteWithMultipleInstancesWithCookie() |
|
99 | + public function testSetFavoriteWithMultipleInstancesWithCookie () |
|
100 | 100 | { |
101 | 101 | $this->favMgr->setFavorite($this->textnode); |
102 | 102 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * @inheritdoc |
44 | 44 | */ |
45 | - public function setUp() |
|
45 | + public function setUp () |
|
46 | 46 | { |
47 | 47 | $this->containerMock = $this->getMockBuilder(Container::class)->setMethods(['hasParameter', 'getParameter'])->getMock(); |
48 | 48 | $this->featureToggle = new FeatureToggle(); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * tests hasFeature() exists |
54 | 54 | */ |
55 | - public function testHasFeatureExists() |
|
55 | + public function testHasFeatureExists () |
|
56 | 56 | { |
57 | 57 | $this->assertTrue(method_exists($this->featureToggle, 'hasFeature')); |
58 | 58 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * tests hasFeature() throws an error because of missing parameter |
62 | 62 | */ |
63 | - public function testHasFeatureThrowsErrorWithMissingParameter() |
|
63 | + public function testHasFeatureThrowsErrorWithMissingParameter () |
|
64 | 64 | { |
65 | 65 | if (version_compare(PHP_VERSION, '7.1.0') >= 0) { |
66 | 66 | $this->expectException(\ArgumentCountError::class); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * tests hasFeature() returns false for unknown feature |
75 | 75 | */ |
76 | - public function testHasFeatureReturnsFalseForUnknownFeature() |
|
76 | + public function testHasFeatureReturnsFalseForUnknownFeature () |
|
77 | 77 | { |
78 | 78 | $this->assertFalse($this->featureToggle->hasFeature('unknownFeature')); |
79 | 79 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * tests hasFeature returns false for test feature |
83 | 83 | */ |
84 | - public function testHasFeatureReturnsFalseForTestFeature() |
|
84 | + public function testHasFeatureReturnsFalseForTestFeature () |
|
85 | 85 | { |
86 | 86 | $this->assertFalse($this->featureToggle->hasFeature('test_feature')); |
87 | 87 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * tests hasFeature() returns false when no parameter exists for test feature |
91 | 91 | */ |
92 | - public function testHasFeatureReturnsWhenNoParameterExistsForTestFeature() |
|
92 | + public function testHasFeatureReturnsWhenNoParameterExistsForTestFeature () |
|
93 | 93 | { |
94 | 94 | $this->containerMock->expects($this->atLeastOnce()) |
95 | 95 | ->method('hasParameter') |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * tests hasFeature() returns true when test Feature is enabled by parameter |
103 | 103 | */ |
104 | - public function testHasFeatureReturnsTrueWhenTestFeatureIsEnabledByParameter() |
|
104 | + public function testHasFeatureReturnsTrueWhenTestFeatureIsEnabledByParameter () |
|
105 | 105 | { |
106 | 106 | $this->containerMock->expects($this->atLeastOnce()) |
107 | 107 | ->method('hasParameter') |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * tests getFeatures() is existing |
121 | 121 | */ |
122 | - public function testGetFeaturesExists() |
|
122 | + public function testGetFeaturesExists () |
|
123 | 123 | { |
124 | 124 | $this->assertTrue(method_exists($this->featureToggle, 'getFeatures')); |
125 | 125 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | /** |
128 | 128 | * tests getFeatures() returns an array |
129 | 129 | */ |
130 | - public function testGetFeaturesReturnsAnArray() |
|
130 | + public function testGetFeaturesReturnsAnArray () |
|
131 | 131 | { |
132 | 132 | $this->assertInternalType('array', $this->featureToggle->getFeatures()); |
133 | 133 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * tests getFeature() count is greater than 1 |
137 | 137 | */ |
138 | - public function testGetFeaturesCountGreaterOne() |
|
138 | + public function testGetFeaturesCountGreaterOne () |
|
139 | 139 | { |
140 | 140 | $this->assertGreaterThan(0, count($this->featureToggle->getFeatures())); |
141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | /** |
144 | 144 | * tests getFeatures() contains the test feature |
145 | 145 | */ |
146 | - public function testGetFeaturesContainsTestFeature() |
|
146 | + public function testGetFeaturesContainsTestFeature () |
|
147 | 147 | { |
148 | 148 | $features = $this->featureToggle->getFeatures(); |
149 | 149 | $this->assertContains('test_feature', $features); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * tests the saving of a readpath node without a given user |
37 | 37 | */ |
38 | - public function testStoreReadpathWithoutUser() |
|
38 | + public function testStoreReadpathWithoutUser () |
|
39 | 39 | { |
40 | 40 | $textnodeMock = $this->getTextnodeMock(); |
41 | 41 | $readpathRepositoryMock = $this->getReadpathRepositoryMock(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * tests the saving of readpath node |
51 | 51 | */ |
52 | - public function testStoreReadpathWithUser() |
|
52 | + public function testStoreReadpathWithUser () |
|
53 | 53 | { |
54 | 54 | $textnodeMockId = 'textnodeId'; |
55 | 55 | $userMockId = 'userId'; |
@@ -68,33 +68,33 @@ discard block |
||
68 | 68 | |
69 | 69 | $readpathRepositoryMock->expects($this->once()) |
70 | 70 | ->method('save') |
71 | - ->willReturnCallback(function (ReadpathDocument $readpathDocument) use ($textnodeMockId, $userMockId) { |
|
71 | + ->willReturnCallback(function(ReadpathDocument $readpathDocument) use ($textnodeMockId, $userMockId) { |
|
72 | 72 | $this->assertInstanceOf(ReadpathDocument::class, $readpathDocument); |
73 | 73 | $this->assertEquals($textnodeMockId, $readpathDocument->getTextnodeId()); |
74 | 74 | $this->assertEquals($userMockId, $readpathDocument->getUserId()); |
75 | 75 | $this->assertInstanceOf(\MongoDate::class, $readpathDocument->getTimestamp()); |
76 | - $this->assertLessThanOrEqual(1, abs($readpathDocument->getTimestamp()->sec-time())); |
|
76 | + $this->assertLessThanOrEqual(1, abs($readpathDocument->getTimestamp()->sec - time())); |
|
77 | 77 | }); |
78 | 78 | |
79 | 79 | $readpath = new Readpath($readpathRepositoryMock); |
80 | 80 | $readpath->storeReadpath($textnodeMock, $userMock); |
81 | 81 | } |
82 | 82 | |
83 | - private function getTextnodeMock() |
|
83 | + private function getTextnodeMock () |
|
84 | 84 | { |
85 | 85 | $textnode = $this->getMockBuilder(Textnode::class)->getMock(); |
86 | 86 | |
87 | 87 | return $textnode; |
88 | 88 | } |
89 | 89 | |
90 | - private function getReadpathRepositoryMock() |
|
90 | + private function getReadpathRepositoryMock () |
|
91 | 91 | { |
92 | 92 | $readpath = $this->getMockBuilder(ReadPathRepository::class)->disableOriginalConstructor()->getMock(); |
93 | 93 | |
94 | 94 | return $readpath; |
95 | 95 | } |
96 | 96 | |
97 | - private function getUserMock() |
|
97 | + private function getUserMock () |
|
98 | 98 | { |
99 | 99 | $user = $this->getMockBuilder(User::class)->getMock(); |
100 | 100 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Test find user by email |
34 | 34 | */ |
35 | - public function testFindByStatusActive() |
|
35 | + public function testFindByStatusActive () |
|
36 | 36 | { |
37 | 37 | $dm = $this->getDocumentManagerMock(); |
38 | 38 | $class = $this->getClassMock(); |