TaxonomysControllerTest.php 43.2 KB
Newer Older
1
<?php
2
3

namespace App\Test\TestCase\Controller\Api\V1;
4
5
6
7
8
9

use App\Controller\TaxonomysController;

/**
 * App\Controller\TaxonomysController Test Case
 */
10
class TaxonomysControllerTest extends ApiIntegrationTestCase
11
12
13
14
15
16
17
18
19
{

    /**
     * Fixtures
     *
     * @var array
     */
    public $fixtures = [
        'app.taxonomys',
20
        'app.taxonomys_softwares',
21
22
23
24
25
26
27
28
29
30
31
        'app.softwares',
        'app.licenses',
        'app.licence_types',
        'app.relationships_softwares_users',
        'app.users',
        'app.user_types',
        'app.reviews',
        'app.relationships',
        'app.relationship_types',
        'app.relationships_softwares',
        'app.relationships_users',
32
33
34
35
36
   //     'app.usedsoftwares',
   //     'app.backedsoftwares',
   //     'app.createdsoftwares',
   //     'app.contributionssoftwares',
   //     'app.providerforsoftwares',
37
38
39
40
        'app.screenshots',
        'app.softwares_statistics',
        'app.tags',
        'app.softwares_tags',
41
42
43
44
45
46
47
    //    'app.userssoftwares',
    //    'app.backerssoftwares',
    //    'app.creatorssoftwares',
    //    'app.contributorssoftwares',
    //    'app.providerssoftwares',
    //    'app.workswellsoftwares',
    //    'app.alternativeto'
48
49
    ];

50

51
52
53
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Public actions /////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
54

55
56
57
58

// Mapping method
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

59
    /**
60
     * Mapping method : main unit tests
61
     *
62
63
64
65
     *      URL: /fr/cartographie
     *           /en/mapping/
     *
     * @group public
66
     * @group taxonomy
67
68
     * @group taxonomy_public
     * @group taxonomy_method_mapping
69
70
71
72
     * @return void
     */
    public function testMapping()
    {
73
74
75
        $url = '/fr/cartographie/';
        $title = "<title>Cartographie des logiciels métiers pour les collectivités</title>";

76
77
        // Anonymous user
        $this->setAnonymousUserSession();
78
79
80
81
82
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains("$title", $html);

83
        // Connected user
84
        $this->setConnectedUserSession();
85
86
87
88
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains("$title", $html);
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
    }

    /**
     * Mapping method
     * Check that redirects work when the URL is slightly different
     * - slash missing at the end of the URL
     * - the language prefix is missing at the beginning of the URL
     * - the user has changed the language prefix in the URL
     *
     *      URL: /fr/cartographie
     *           /en/mapping/
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mapping
     * @return void
     */
    public function testMappingCheckRedirects()
    {
110
111
        // Anonymous user
        $this->setAnonymousUserSession();
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
        // French user:
        $expectedUrl = '/fr/cartographie/';
        $testeddUrl = '/fr/cartographie'; // slash missing at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/fr/mapping/'; // the user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/';
        $testeddUrl = '/en/mapping'; // slash missing at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/en/cartographie/'; // the user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  English user: language prefix is missing at the beginning of URL
        $expectedUrl = '/en/mapping/';
        $this->get("/en/"); // force user language to english
        $testeddUrl = '/mapping/'; //  the language prefix is missing at the beginning of URLs
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/cartographie/';
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  French user: language prefix is missing at the beginning of URL
        $expectedUrl = '/fr/cartographie/';
        $this->get("/fr/"); // force user language to french
        $testeddUrl = '/mapping'; //  the language prefix is missing at the beginning of URLs
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/cartographie'; //  the language prefix is missing at the beginning of URLs
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }

    /**
     * Mapping method with URL prefix /api/v1/
     * - HTML format redirects to the official URL
     * - JSON format returns a 404 "not found" error.
     *
     *      URL: /api/v1/taxonomys/mapping
     *      URL: /api/v1/taxonomys/mapping.json
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mapping
     * @return void
     */
    public function testMappingCheckApiPrefixInUrl()
    {
        $url = '/api/v1/taxonomys/mapping';
        $expectedUrl = '/fr/cartographie/';

164
        // Connected user
165
        $this->setConnectedUserSession();
166
167
168
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
169

170
        // Anonymous user
171
        $this->setAnonymousUserSession();
172
173
174
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
175
    }
176
177


178
179
180
// MappingPrimaryLevel method
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

181
    /**
182
183
184
185
     * MappingPrimaryLevel method : main unit tests
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>
     *           /en/mapping/<slugPrimaryLevel>
186
     *
187
188
189
     *      ex:  /en/mapping/business     /fr/cartographie/metiers
     *           /en/mapping/activities   /fr/cartographie/activites
     *           /en/mapping/generics     /fr/cartographie/generiques
190
     *
191
     * @group public
192
     * @group taxonomy
193
194
     * @group taxonomy_public
     * @group taxonomy_method_mappingPrimaryLevel
195
     * @return void
196
     */
197
    public function testPrimaryLevel()
198
    {
199
        $url = '/fr/cartographie/metiers/';
200
        $title = "<title>Métiers";
201

202
203
        // Anonymous user
        $this->setAnonymousUserSession();
204
205
206
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
207
        $this->assertContains("$title", $html);
208

209
        // Connected user
210
        $this->setConnectedUserSession();
211
212
213
214
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains("$title", $html);
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
    }

    /**
     * MappingPrimaryLevel method
     * Check that redirects work when the URL is slightly different
     * - slash missing at the end of the URL
     * - the language prefix is missing at the beginning of the URL
     * - the user has changed the language prefix in the URL ----> redirect to '/en/mapping/' or '/fr/cartographie/'
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>
     *           /en/mapping/<slugPrimaryLevel>
     *
     *      ex:  /en/mapping/business     /fr/cartographie/metiers
     *           /en/mapping/activities   /fr/cartographie/activites
     *           /en/mapping/generics     /fr/cartographie/generiques
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingPrimaryLevel
     * @return void
     */
    public function testPrimaryLevelCheckRedirects()
    {
240
241
        // Anonymous user
        $this->setAnonymousUserSession();
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266

        // French user:
        $expectedUrl = '/fr/cartographie/metiers/';
        $testeddUrl = '/fr/cartographie/metiers'; // slash missing at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/en/cartographie/metiers/'; // the user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, '/en/mapping/', ['html'], 301);

        //  French user: language prefix is missing at the beginning of URL
        $this->get("/fr/"); // force user language to french
        $testeddUrl = '/cartographie/metiers/'; //  the language prefix is missing at the beginning of URLs
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/business/';
        $testeddUrl = '/en/mapping/business'; // slash missing at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/fr/mapping/business/'; // the user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, '/fr/cartographie/', ['html'], 301);

        //  English user: language prefix is missing at the beginning of URL
        $this->get("/en/"); // force user language to english
        $testeddUrl = '/mapping/business/'; //  the language prefix is missing at the beginning of URLs
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }
267

268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291


    /**
     * MappingPrimaryLevel method
     *
     * Check that if the first level requested does not exist,
     * a redirection is made to '/en/mapping/' or '/fr/cartographie/'
     *
     *      URL: /fr/cartographie/<slugPrimaryLevelNotFound>
     *           /en/mapping/<slugPrimaryLevelNotFound>
     *
     *      ex:  /en/mapping/business     /fr/cartographie/metiers
     *           /en/mapping/activities   /fr/cartographie/activites
     *           /en/mapping/generics     /fr/cartographie/generiques
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingPrimaryLevel
     * @return void
     */
    public function testPrimaryLevelNotFound()
    {
292
293
        // Anonymous user
        $this->setAnonymousUserSession();
294

295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
        // French user:
        $expectedUrl = '/fr/cartographie/';
        $testeddUrl = '/fr/cartographie/PremierNiveauInconnu';
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/';
        $testeddUrl = '/en/mapping/notFoundPrimaryLevel';
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }

    /**
     * MappingPrimaryLevel method with URL prefix /api/v1/
     * - HTML format redirects to the official URL
     * - JSON format returns a 404 "not found" error.
     *
     *      URL: /api/v1/taxonomys/mappingPrimaryLevel/<id>       ---> redirect to /en/mapping/ or /fr/cartographie/
     *      URL: /api/v1/taxonomys/mappingPrimaryLevel/<id>.json  ---> disable: 404 not found
     *
     * @group taxonomy
     * @group taxonomy_notAllowed
     * @group taxonomy_method_mappingPrimaryLevel
     * @return void
     */
    public function testPrimaryLevelCheckApiPrefixInUrl()
    {
        $url = '/api/v1/taxonomys/mappingPrimaryLevel/1';
        $expectedUrl = '/fr/cartographie/';

324
        // Connected user
325
        $this->setConnectedUserSession();
326
327
328
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
329

330
        // Anonymous user
331
        $this->setAnonymousUserSession();
332
333
334
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
335
336
337
    }


338
339
340
// MappingTaxon method
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

341
    /**
342
     * Test mappingTaxon method : a taxon has a software with users (one or more)
343
     *
344
345
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
346
     *
347
348
349
350
     *      ex:  /fr/cartographie/metiers/sante-social/14      /en/mapping/business/healthcare-social/14
     *           /fr/cartographie/generiques/bureautique/20    /en/mapping/generics/office-automation/20
     *
     * @group public
351
     * @group taxonomy
352
353
     * @group taxonomy_public
     * @group taxonomy_method_mappingTaxon
354
     * @return void
355
     */
356
    public function testMappingTaxonShouldHaveSoftwareWithUsers()
357
    {
358
359
360
361
        $idTaxon = 3;
        $idSoftware = 1;
        $url = "/fr/cartographie/metiers/urbanisme-espace-public-environnement/$idTaxon";
        $htmlTitle = "<title>Urbanisme / Espace public / Environnement";
362

363
364
        // Anonymous user
        $this->setAnonymousUserSession();
365
        $r = $this->checkUrlOk($url, ['html']);
366
367
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
368
369
370
371
372
        $this->assertContains($htmlTitle, $html);
        $this->assertContains("id=\"sofwareListForTaxon$idTaxon\"", $html);
        $this->assertContains("class=\"item-softwareForTaxon$idTaxon\"", $html);
        $this->assertContains("id=\"item-software$idSoftware-forTaxon$idTaxon\"", $html);
        $this->assertContains("id=\"link-software$idSoftware-forTaxon$idTaxon\"", $html);
373
374
375

        // Connected user
        $this->setConnectedUserSession();
376
377
378
379
380
381
382
383
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains($htmlTitle, $html);
        $this->assertContains("id=\"sofwareListForTaxon$idTaxon\"", $html);
        $this->assertContains("class=\"item-softwareForTaxon$idTaxon\"", $html);
        $this->assertContains("id=\"item-software$idSoftware-forTaxon$idTaxon\"", $html);
        $this->assertContains("id=\"link-software$idSoftware-forTaxon$idTaxon\"", $html);
384
385
386
    }


387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
    /**
     * Test mappingTaxon method : a taxon has a software without user (preselected software)
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *
     *      ex:  /fr/cartographie/metiers/sante-social/14      /en/mapping/business/healthcare-social/14
     *           /fr/cartographie/generiques/bureautique/20    /en/mapping/generics/office-automation/20
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingTaxon
     * @return void
     */
    public function testMappingTaxonShouldHaveSoftwareWithoutUsers()
    {
        $idTaxon = 6;
        $idSoftware = 4;
        $url = "/fr/cartographie/generiques/design/$idTaxon";
        $htmlTitle = "<title>Design";

409
410
        // Anonymous user
        $this->setAnonymousUserSession();
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains($htmlTitle, $html);
        $this->assertContains("id=\"sofwareListForTaxon$idTaxon\"", $html);
        $this->assertContains("class=\"item-softwareForTaxon$idTaxon\"", $html);
        $this->assertContains("id=\"item-software$idSoftware-forTaxon$idTaxon\"", $html);
        $this->assertNotContains("id=\"link-software$idSoftware-forTaxon$idTaxon\"", $html);
    }


    /**
     * Test mappingTaxon method : a taxon has no software
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *
     *      ex:  /fr/cartographie/metiers/sante-social/14      /en/mapping/business/healthcare-social/14
     *           /fr/cartographie/generiques/bureautique/20    /en/mapping/generics/office-automation/20
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingTaxon
     * @return void
     */
    public function testMappingTaxonShouldNotHaveSoftware()
    {
        $idTaxon = 4;
        $url = "/fr/cartographie/generiques/bureautique/$idTaxon";
        $htmlTitle = "<title>Bureautique";

443
444
        // Anonymous user
        $this->setAnonymousUserSession();
445
446
447
448
449
450
451
452
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', $html);
        $this->assertContains($htmlTitle, $html);
        $this->assertNotContains("id=\"sofwareListForTaxon$idTaxon\"", $html);
        $this->assertNotContains("class=\"item-softwareForTaxon$idTaxon\"", $html);
    }

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
    /**
     * MappingTaxon method
     *
     * Check that redirects work when the URL is slightly different
     * - extra slash at the end of the URL
     * - the language prefix is missing at the beginning of the URL
     * - the user has changed the language prefix in the URL
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *
     *      ex:  /fr/cartographie/metiers/sante-social/14      /en/mapping/business/healthcare-social/14
     *           /fr/cartographie/generiques/bureautique/20    /en/mapping/generics/office-automation/20
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingTaxon
     * @return void
     */
    public function testMappingTaxonCheckRedirects()
    {
476
477
        // Anonymous user
        $this->setAnonymousUserSession();
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526

        // French user:
        $expectedUrl = '/fr/cartographie/generiques/bureautique/4';
        $testeddUrl = '/fr/cartographie/generiques/bureautique/4/'; // extra slash at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/fr/mapping/generics/office-automation/4'; // the user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  French user: language prefix is missing at the beginning of URL
        $this->get("/fr/"); // force user language to french
        $testeddUrl = '/cartographie/generiques/bureautique/4'; // language prefix is missing at the beginning of URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/generics/office-automation/4';
        $testeddUrl = '/en/mapping/generics/office-automation/4/'; // extra slash at the end of the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
        $testeddUrl = '/en/cartographie/generiques/bureautique/4'; // user has changed the language prefix in the URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  English user: language prefix is missing at the beginning of URL
        $this->get("/en/"); // force user language to english
        $testeddUrl = '/mapping/generics/office-automation/4'; //  language prefix is missing at the beginning of URL
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }



    /**
     * MappingTaxon method
     *
     * Check that if the requested taxon does not exist,
     * a redirection is made to '/en/mapping/' or '/fr/cartographie/'
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<taxonId_notFound>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId_notFound>
     *
     *      ex:  /fr/cartographie/metiers/sante-social/14      /en/mapping/business/healthcare-social/14
     *           /fr/cartographie/generiques/bureautique/20    /en/mapping/generics/office-automation/20
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_method_mappingTaxon
     * @return void
     */
    public function testMappingTaxonNotFound()
    {
527
528
        // Anonymous user
        $this->setAnonymousUserSession();
529
530
531
532
533
534
535
536
537
538

        // French user:
        $expectedUrl = '/fr/cartographie/';
        $testeddUrl = '/fr/cartographie/metiers/notFoundTaxon/825';
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/';
        $testeddUrl = '/en/mapping/metiers/notFoundTaxon/825';
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
539
540
    }

541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
    /**
     * MappingTaxon method with URL prefix /api/v1/
     * - HTML format redirects to the official URL
     * - JSON format returns a 404 "not found" error.
     *
     *      URL: /api/v1/taxonomys/mappingTaxon/<id>       ---> redirect to /en/mapping/ or /fr/cartographie/
     *      URL: /api/v1/taxonomys/mappingTaxon/<id>.json  ---> disable: 404 not found
     *
     * @group taxonomy
     * @group taxonomy_notAllowed
     * @group taxonomy_method_mappingTaxon
     * @return void
     */
    public function testMappingTaxonCheckApiPrefixInUrl()
    {
        $url = '/api/v1/taxonomys/mappingTaxon/4';
        $expectedUrl = '/fr/cartographie/';
558

559
        // Connected user
560
        $this->setConnectedUserSession();
561
562
563
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
564

565
        // Anonymous user
566
        $this->setAnonymousUserSession();
567
568
569
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($url, ['json']); // JSON format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301); // HTML format
570
    }
571

572
573
574
575
576

// mappingTaxonUsersOf method
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /**
577
578
     * mappingTaxonUsersOf method:
     * a taxon has a software with users (one or more), without comment
579
580
581
582
583
584
585
586
587
588
589
590
591
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
592
    public function testMappingTaxonUsersOfShouldHaveSoftwareWithUsersWithoutComments()
593
594
595
    {
        $idTaxon = 3;
        $idSoftware = 1;
596
597
        $idUserA = 2;
        $idUserB = 4;
598
599
600
        $url = "/fr/cartographie/metiers/urbanisme-espace-public-environnement/asalae/$idTaxon.$idSoftware";
        $title = "<title>Utilisateurs du logiciel Asalae - Urbanisme / Espace public / Environnement";

601
602
        // Connected user (type != "Administration")   --> to be deleted when development is complete.
        $this->setConnectedPersonSession();
603
604
605
606
607
608
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', "$html");
        $this->assertContains("$title", "$html");
        $this->assertContains("id=\"mappingTaxon$idTaxon-UsersOf$idSoftware\"", $html); // <section id="">
        $this->assertContains("class=\"mappingTaxonUsersOfPage", $html);                   // <section class="">
609
610
611
        $this->assertContains("id=\"userPreviewCard-$idUserA\"", $html);
        $this->assertContains("id=\"userPreviewCard-$idUserB\"", $html);
        $this->assertNotContains("class=\"taxonomyComment\"", $html);
612

613
        // Anonymous user
614
        $this->setAnonymousUserSession();
615
616
617
618
619
620
621
622
623
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
        $this->assertContains('<html lang="fr">', "$html");
        $this->assertContains("$title", "$html");
        $this->assertContains("id=\"mappingTaxon$idTaxon-UsersOf$idSoftware\"", $html); // <section id="">
        $this->assertContains("class=\"mappingTaxonUsersOfPage", $html);                   // <section class="">
        $this->assertContains("id=\"userPreviewCard-$idUserA\"", $html);
        $this->assertContains("id=\"userPreviewCard-$idUserB\"", $html);
        $this->assertNotContains("class=\"taxonomyComment\"", $html);
624
625
626
    }


627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
    /**
     * mappingTaxonUsersOf method:
     * a taxon has a software with users (one or more), with comment (one or more)
     *
     *      URL: /fr/cartographie/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *           /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMappingTaxonUsersOfShouldHaveSoftwareWithUsersWithComments()
    {
        $idTaxon = 5;
        $idSoftware = 2;
        $idUser = 3;
        $url = "/fr/cartographie/generiques/infrastructure/lutece/$idTaxon.$idSoftware";
        $title = "<title>Utilisateurs du logiciel Lutèce - Infrastructure";

652
653
        // Anonymous user
        $this->setAnonymousUserSession();
654
655
        $r = $this->checkUrlOk($url, ['html']);
        $html = $r['html']['data'];
656
657
658
659
660
661
662
663
664
//        $this->assertContains('<html lang="fr">', "$html");
//        $this->assertContains("$title", "$html");
//        $this->assertContains("id=\"mappingTaxon$idTaxon-UsersOf$idSoftware\"", $html); // <section id="">
//        $this->assertContains("class=\"mappingTaxonUsersOfPage", $html);                   // <section class="">
//        $this->assertContains("id=\"userPreviewCard-$idUser\"", $html);
//        $this->assertContains("class=\"taxonomyComment\"", $html);
//        $this->assertContains("id=\"mappingTaxon$idTaxon-UsersOf$idSoftware-comment-user$idUser\"", $html);
//        $this->assertContains("blabla bla du comentaire", $html);
        $this->markTestIncomplete('Not implemented yet.');
665
666
667
    }


668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
    /**
     * mappingTaxonUsersOf method: a taxon has a software without user (preselected software)
     *
     *      URL: /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId_withoutUser>
     *           ----> redirect to /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMappingTaxonUsersOfShouldHaveSoftwareWithoutUsers()
    {
        $idTaxon = 6;
        $idSoftware = 4;
        $testeddUrl = "/fr/cartographie/generiques/design/soft-4/$idTaxon.$idSoftware";

689
690
        // Anonymous user
        $this->setAnonymousUserSession();
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
        $expectedUrl = "/fr/cartographie/generiques/design/$idTaxon";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }


    /**
     * MappingTaxonUsersOf method: a taxon is not associated with this software
     *
     *      URL: /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId_notAssociated>
     *           ----> redirect to /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<taxonId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMappingTaxonUsersOfShouldNotBeAssociatedWithThisSoftware()
    {
        $idTaxon = 4;
        $idSoftware = 4;
        $testeddUrl = "/fr/cartographie/generiques/bureautique/soft-4/$idTaxon.$idSoftware";

717
718
        // Anonymous user
        $this->setAnonymousUserSession();
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
        $expectedUrl = "/fr/cartographie/generiques/bureautique/$idTaxon";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }


    /**
     * MappingTaxonUsersOf method: taxon not found in database
     *
     * Check that if the requested taxon does not exist,
     * a redirection is made to '/en/mapping/' or '/fr/cartographie/'
     *
     *      URL: /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId_notFound>.<softwareId>
     *           /fr/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId_notFound>.<softwareId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMappingTaxonUsersOfTaxonNotFound()
    {
        $idTaxon = 999; // not found taxon
        $idSoftware = 4;

748
749
        // Anonymous user
        $this->setAnonymousUserSession();
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788

        // French user:
        $expectedUrl = '/fr/cartographie/';
        $testeddUrl = "/fr/cartographie/metiers/notFoundTaxon/soft4Name/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        $expectedUrl = '/en/mapping/';
        $testeddUrl = "/en/mapping/business/notFoundTaxon/soft4Name/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }


    /**
     * MappingTaxonUsersOf method:
     *
     * Check that redirects work when the URL is slightly different
     * - extra slash at the end of the URL
     * - the language prefix is missing at the beginning of the URL
     * - the user has changed the language prefix in the URL
     *
     *      URL: /en/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *           /fr/mapping/<slugPrimaryLevel>/<slugTaxon>/<slugSoftware>/<taxonId>.<softwareId>
     *
     *      ex:  /fr/cartographie/generiques/bureautique/libreoffice/20.33
     *           /en/mapping/generics/office-automation/libreoffice/20.33
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMMappingTaxonUsersOfCheckRedirects()
    {
        $idTaxon = 5;
        $idSoftware = 4;

789
790
        // Anonymous user
        $this->setAnonymousUserSession();
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850

        // French user
        //////////////////////////////////////////
        $expectedUrl = "/fr/cartographie/generiques/infrastructure/soft-4/$idTaxon.$idSoftware";

        // extra slash at the end of the URL
        $testeddUrl = "$expectedUrl/";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // the user has changed the language prefix in the URL
        $testeddUrl = "/fr/mapping/generics/infrastructure/soft-4/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  French user: language prefix is missing at the beginning of URL
        $this->get("/fr/"); // force user language to french
        $testeddUrl = "/cartographie/generiques/infrastructure/soft-4/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // English user
        //////////////////////////////////////////
        $expectedUrl = "/en/mapping/generics/infrastructure/soft-4/$idTaxon.$idSoftware";

        // extra slash at the end of the URL
        $testeddUrl = "$expectedUrl/";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        // user has changed the language prefix in the URL
        $testeddUrl = "/en/cartographie/generiques/infrastructure/soft-4/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);

        //  English user: language prefix is missing at the beginning of URL
        $this->get("/en/"); // force user language to english
        $testeddUrl = "/mapping/generics/infrastructure/soft-4/$idTaxon.$idSoftware";
        $this->checkUrlRedirectToAnotherUrl($testeddUrl, $expectedUrl, ['html'], 301);
    }




    /**
     * MappingTaxonUsersOf method with URL prefix /api/v1/
     * - HTML format redirects to the official URL
     * - JSON format returns a 404 "not found" error.
     *
     *    URL: /api/v1/taxonomys/mappingTaxonUsersOf           ---> redirect to '/en/mapping/'
     *         /api/v1/taxonomys/mappingTaxonUsersOf/<id>      ---> redirect to '/en/mapping/'
     *         /api/v1/taxonomys/mappingTaxonUsersOf.json      ---> disable via parent::beforeFilter()
     *         /api/v1/taxonomys/mappingTaxonUsersOf/<id>.json ---> disable via parent::beforeFilter()
     *
     * @group seo
     * @group public
     * @group taxonomy
     * @group taxonomy_public
     * @group taxonomy_mappingTaxonUsersOf
     * @return void
     */
    public function testMappingTaxonUsersOfCheckApiPrefixInUrl()
    {
        $urlBase = '/api/v1/taxonomys/mappingTaxonUsersOf'; // missing software ID
        $url = "$urlBase/2"; // software ID 2
851
        $expectedUrl = '/fr/cartographie/';
852

853
        // Connected user
854
        $this->setConnectedUserSession();
855
856
857
858
859
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($urlBase, ['json']); // JSON format
        $this->checkUrlNotFound($url, ['json']);     // JSON format
        $this->checkUrlRedirectToAnotherUrl($urlBase, $expectedUrl, ['html'], 301); // HTML format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301);     // HTML format
860

861
        // Anonymous user
862
        $this->setAnonymousUserSession();
863
864
865
866
867
        $this->get("/fr/"); // force user language to french
        $this->checkUrlNotFound($urlBase, ['json']); // JSON format
        $this->checkUrlNotFound($url, ['json']);     // JSON format
        $this->checkUrlRedirectToAnotherUrl($urlBase, $expectedUrl, ['html'], 301); // HTML format
        $this->checkUrlRedirectToAnotherUrl($url, $expectedUrl, ['html'], 301);     // HTML format
868
869
870
871
    }



872
873
874
875
876
877
878
879
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Admin actions ---> self-generated by CakePHP  //////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


    // Admin user
    /////////////////////////////////////////////////////////////////////////////////////////

880
881
882
883
884
885
886
887
    /**
     * Test index method for admin user ---> allowed
     *
     *      URL: /api/v1/taxonomys
     *           ----> allowed only for user with "admin" role
     *
     * @group admin
     * @group taxonomy
888
889
890
     * @group taxonomy_admin
     * @group taxonomy_method_index
     *
891
892
     * @return void
     */
893
    public function testIndexForAdminUser()
894
    {
895
        $this->setAdminSessionOfPersonType();
896
        $this->checkUrlOk('/api/v1/taxonomys');
897
898
899
900
901
    }

    /**
     * Test view method
     *
902
903
904
905
906
     *      URL: /api/v1/taxonomys/view/1
     *           ----> allowed only for user with "admin" role
     *
     * @group admin
     * @group taxonomy
907
908
     * @group taxonomy_admin
     * @group taxonomy_method_view
909
910
     * @return void
     */
911
    public function testViewForAdminUser()
912
    {
913
        $this->setAdminSessionOfPersonType();
914
        $this->checkUrlOk('/api/v1/taxonomys/view/1');
915
916
917
918
919
    }

    /**
     * Test add method
     *
920
921
922
     *      URL: /api/v1/taxonomys/add
     *           ----> allowed only for user with "admin" role
     *
923
     * @todo Not implemented yet.
924
925
     * @group admin
     * @group taxonomy
926
927
     * @group taxonomy_admin
     * @group taxonomy_method_add
928
929
     * @return void
     */
930
    public function testAddForAdminUser()
931
    {
932
        $this->setAdminSessionOfPersonType();
933
        $this->checkUrlOk('/api/v1/taxonomys/add');
934

935
936
937
938
939
940
        $this->markTestIncomplete('Not implemented yet.');
    }

    /**
     * Test edit method
     *
941
942
943
     *      URL: /api/v1/taxonomys
     *           ----> allowed only for user with "admin" role
     *
944
     * @todo  not implemented yet.
945
946
     * @group admin
     * @group taxonomy
947
948
     * @group taxonomy_admin
     * @group taxonomy_method_edit
949
950
     * @return void
     */
951
    public function testEditForAdminUser()
952
    {
953
        $this->setAdminSessionOfPersonType();
954
        $this->checkUrlOk('/api/v1/taxonomys/edit/1');
955

956
957
958
959
960
961
        $this->markTestIncomplete('Not implemented yet.');
    }

    /**
     * Test delete method
     *
962
963
964
     *      URL: /api/v1/taxonomys
     *           ----> allowed only for user with "admin" role
     *
965
     * @todo  not implemented yet.
966
967
     * @group admin
     * @group taxonomy
968
969
     * @group taxonomy_admin
     * @group taxonomy_method_delete
970
971
972
973
     * @return void
     */
    public function testDeleteForAdminUser()
    {
974
        $this->setAdminSessionOfPersonType();
975

976
977
978
979
980
981
982
983
984
985
986
987
988
        $this->markTestIncomplete('Not implemented yet.');
    }


    // Connected user
    /////////////////////////////////////////////////////////////////////////////////////////

    /**
     * Test index method for connected user ---> not authorized
     *
     *      URL: /api/v1/taxonomys
     *           ----> allowed only for user with "admin" role
     *
989
     * @group security
990
     * @group user
991
     * @group admin
992
     * @group taxonomy
993
994
     * @group taxonomy_admin
     * @group taxonomy_method_index
995
996
997
998
     * @return void
     */
    public function testFailIndexForConnectedUser()
    {
999
1000
        $this->setConnectedUserSession();
        $this->checkUrlNotAuthorized('/api/v1/taxonomys');
1001
1002
1003
1004
1005
1006
1007
1008
    }

    /**
     * Test view method for connected user ---> not authorized
     *
     *      URL: /api/v1/taxonomys/view/1
     *           ----> allowed only for user with "admin" role
     *
1009
     * @group security
1010
     * @group user
1011
     * @group admin
1012
     * @group taxonomy
1013
1014
     * @group taxonomy_admin
     * @group taxonomy_method_view
1015
1016
1017
1018
     * @return void
     */
    public function testFailViewForConnectedUser()
    {
1019
1020
        $this->setConnectedUserSession();
        $this->checkUrlNotAuthorized('/api/v1/taxonomys/view/1');
1021
1022
1023
1024
1025
    }

    /**
     * Test add method for connected user
     * GET ---> not authorized
1026
     * POST ---> @todo  not implemented yet
1027
1028
1029
1030
     *
     *      URL: /api/v1/taxonomys/add
     *           ----> allowed only for user with "admin" role
     *
1031
     * @group security
1032
     * @group user
1033
     * @group admin
1034
     * @group taxonomy
1035
1036
     * @group taxonomy_admin
     * @group taxonomy_method_add
1037
1038
1039
1040
     * @return void
     */
    public function testFailAddForConnectedUser()
    {
1041
1042
1043
1044
        $this->setConnectedUserSession();
        $this->checkUrlNotAuthorized('/api/v1/taxonomys/add');

        $this->markTestIncomplete('Not implemented yet.');
1045
1046
1047
1048
1049
    }

    /**
     * Test edit method for connected user
     * GET ---> not authorized
1050
     * POST ---> @todo  not implemented yet
1051
     *
1052
     * @group security
1053
     * @group user
1054
     * @group admin
1055
     * @group taxonomy
1056
1057
     * @group taxonomy_admin
     * @group taxonomy_method_edit
1058
1059
1060
1061
     * @return void
     */
    public function testFailEditForConnectedUser()
    {
1062
1063
1064
1065
        $this->setConnectedUserSession();
        $this->checkUrlNotAuthorized('/api/v1/taxonomys/edit/1');

        $this->markTestIncomplete('Not implemented yet.');
1066
1067
1068
1069
1070
    }

    /**
     * Test delete method for connected user
     *
1071
     * @todo    not implemented yet
1072
1073
     *
     * @group security
1074
     * @group user
1075
     * @group admin
1076
     * @group taxonomy
1077
1078
     * @group taxonomy_admin
     * @group taxonomy_method_delete
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
     * @return void
     */
    public function testFailDeleteForConnectedUser()
    {
        $this->markTestIncomplete('Not implemented yet.');
    }


    // Anonymous user
    /////////////////////////////////////////////////////////////////////////////////////////

    /**
     * Test index method for anonymous user ---> redirect to login form
     *
     *      URL: /api/v1/taxonomys
     *           ----> allowed only for user with "admin" role
     *
1096
     * @group security
1097
     * @group anonymous
1098
     * @group admin
1099
     * @group taxonomy
1100
1101
     * @group taxonomy_admin
     * @group taxonomy_method_index
1102
1103
1104
1105
     * @return void
     */
    public function testFailIndexForAnonymousUser()
    {
1106
1107
        $this->setAnonymousUserSession();
        $this->checkUrlRedirectToLogin('/api/v1/taxonomys');
1108
1109
1110
1111
1112
1113
1114
1115
    }

    /**
     * Test view method for anonymous user ---> redirect to login form
     *
     *      URL: /api/v1/taxonomys/view/1
     *           ----> allowed only for user with "admin" role
     *
1116
     * @group security
1117
     * @group anonymous
1118
     * @group admin
1119
     * @group taxonomy
1120
1121
     * @group taxonomy_admin
     * @group taxonomy_method_view
1122
1123
1124
1125
     * @return void
     */
    public function testFailViewForAnonymousUser()
    {
1126
1127
        $this->setAnonymousUserSession();
        $this->checkUrlRedirectToLogin('/api/v1/taxonomys/view/1');
1128
1129
1130
1131
1132
    }

    /**
     * Test add method for anonymous user
     * GET ---> redirect to login form
1133
     * POST ---> @todo  not implemented yet
1134
1135
1136
1137
     *
     *      URL: /api/v1/taxonomys/add
     *           ----> allowed only for user with "admin" role
     *
1138
     * @group security
1139
     * @group anonymous
1140
     * @group admin
1141
     * @group taxonomy
1142
1143
     * @group taxonomy_admin
     * @group taxonomy_method_add
1144
1145
1146
1147
     * @return void
     */
    public function testFailAddForAnonymousUser()
    {
1148
1149
1150
1151
        $this->setAnonymousUserSession();
        $this->checkUrlRedirectToLogin('/api/v1/taxonomys/add');

        $this->markTestIncomplete('Not implemented yet.');
1152
1153
1154
1155
1156
    }

    /**
     * Test edit method for anonymous user
     * GET ---> redirect to login form
1157
     * POST ---> @todo  not implemented yet
1158
     *
1159
     * @group security
1160
     * @group anonymous
1161
     * @group admin
1162
     * @group taxonomy
1163
1164
     * @group taxonomy_admin
     * @group taxonomy_method_edit
1165
1166
1167
1168
     * @return void
     */
    public function testFailEditForAnonymousUser()
    {
1169
1170
1171
1172
        $this->setAnonymousUserSession();
        $this->checkUrlRedirectToLogin('/api/v1/taxonomys/edit/1');

        $this->markTestIncomplete('Not implemented yet.');
1173
1174
1175
1176
    }

    /**
     * Test delete method for anonymous user
1177
1178
     *
     * @todo  not implemented yet
1179
     *
1180
     * @group security
1181
     * @group anonymous
1182
     * @group admin
1183
     * @group taxonomy
1184
1185
     * @group taxonomy_admin
     * @group taxonomy_method_delete
1186
1187
     * @return void
     */
1188
    public function testFailDeleteForAnonymousUser()
1189
1190
1191
1192
    {
        $this->markTestIncomplete('Not implemented yet.');
    }
}