Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of PHPUnit.
4
 *
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PHPUnit\TextUI\XmlConfiguration;
11
 
12
/**
13
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
14
 *
15
 * @psalm-immutable
16
 */
17
final class PHPUnit
18
{
19
    /**
20
     * @var bool
21
     */
22
    private $cacheResult;
23
 
24
    /**
25
     * @var ?string
26
     */
27
    private $cacheResultFile;
28
 
29
    /**
30
     * @var int|string
31
     */
32
    private $columns;
33
 
34
    /**
35
     * @var string
36
     */
37
    private $colors;
38
 
39
    /**
40
     * @var bool
41
     */
42
    private $stderr;
43
 
44
    /**
45
     * @var bool
46
     */
47
    private $noInteraction;
48
 
49
    /**
50
     * @var bool
51
     */
52
    private $verbose;
53
 
54
    /**
55
     * @var bool
56
     */
57
    private $reverseDefectList;
58
 
59
    /**
60
     * @var bool
61
     */
62
    private $convertDeprecationsToExceptions;
63
 
64
    /**
65
     * @var bool
66
     */
67
    private $convertErrorsToExceptions;
68
 
69
    /**
70
     * @var bool
71
     */
72
    private $convertNoticesToExceptions;
73
 
74
    /**
75
     * @var bool
76
     */
77
    private $convertWarningsToExceptions;
78
 
79
    /**
80
     * @var bool
81
     */
82
    private $forceCoversAnnotation;
83
 
84
    /**
85
     * @var ?string
86
     */
87
    private $bootstrap;
88
 
89
    /**
90
     * @var bool
91
     */
92
    private $processIsolation;
93
 
94
    /**
95
     * @var bool
96
     */
97
    private $failOnEmptyTestSuite;
98
 
99
    /**
100
     * @var bool
101
     */
102
    private $failOnIncomplete;
103
 
104
    /**
105
     * @var bool
106
     */
107
    private $failOnRisky;
108
 
109
    /**
110
     * @var bool
111
     */
112
    private $failOnSkipped;
113
 
114
    /**
115
     * @var bool
116
     */
117
    private $failOnWarning;
118
 
119
    /**
120
     * @var bool
121
     */
122
    private $stopOnDefect;
123
 
124
    /**
125
     * @var bool
126
     */
127
    private $stopOnError;
128
 
129
    /**
130
     * @var bool
131
     */
132
    private $stopOnFailure;
133
 
134
    /**
135
     * @var bool
136
     */
137
    private $stopOnWarning;
138
 
139
    /**
140
     * @var bool
141
     */
142
    private $stopOnIncomplete;
143
 
144
    /**
145
     * @var bool
146
     */
147
    private $stopOnRisky;
148
 
149
    /**
150
     * @var bool
151
     */
152
    private $stopOnSkipped;
153
 
154
    /**
155
     * @var ?string
156
     */
157
    private $extensionsDirectory;
158
 
159
    /**
160
     * @var ?string
161
     *
162
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
163
     */
164
    private $testSuiteLoaderClass;
165
 
166
    /**
167
     * @var ?string
168
     *
169
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
170
     */
171
    private $testSuiteLoaderFile;
172
 
173
    /**
174
     * @var ?string
175
     */
176
    private $printerClass;
177
 
178
    /**
179
     * @var ?string
180
     */
181
    private $printerFile;
182
 
183
    /**
184
     * @var bool
185
     */
186
    private $beStrictAboutChangesToGlobalState;
187
 
188
    /**
189
     * @var bool
190
     */
191
    private $beStrictAboutOutputDuringTests;
192
 
193
    /**
194
     * @var bool
195
     */
196
    private $beStrictAboutResourceUsageDuringSmallTests;
197
 
198
    /**
199
     * @var bool
200
     */
201
    private $beStrictAboutTestsThatDoNotTestAnything;
202
 
203
    /**
204
     * @var bool
205
     */
206
    private $beStrictAboutTodoAnnotatedTests;
207
 
208
    /**
209
     * @var bool
210
     */
211
    private $beStrictAboutCoversAnnotation;
212
 
213
    /**
214
     * @var bool
215
     */
216
    private $enforceTimeLimit;
217
 
218
    /**
219
     * @var int
220
     */
221
    private $defaultTimeLimit;
222
 
223
    /**
224
     * @var int
225
     */
226
    private $timeoutForSmallTests;
227
 
228
    /**
229
     * @var int
230
     */
231
    private $timeoutForMediumTests;
232
 
233
    /**
234
     * @var int
235
     */
236
    private $timeoutForLargeTests;
237
 
238
    /**
239
     * @var ?string
240
     */
241
    private $defaultTestSuite;
242
 
243
    /**
244
     * @var int
245
     */
246
    private $executionOrder;
247
 
248
    /**
249
     * @var bool
250
     */
251
    private $resolveDependencies;
252
 
253
    /**
254
     * @var bool
255
     */
256
    private $defectsFirst;
257
 
258
    /**
259
     * @var bool
260
     */
261
    private $backupGlobals;
262
 
263
    /**
264
     * @var bool
265
     */
266
    private $backupStaticAttributes;
267
 
268
    /**
269
     * @var bool
270
     */
271
    private $registerMockObjectsFromTestArgumentsRecursively;
272
 
273
    /**
274
     * @var bool
275
     */
276
    private $conflictBetweenPrinterClassAndTestdox;
277
 
278
    public function __construct(bool $cacheResult, ?string $cacheResultFile, $columns, string $colors, bool $stderr, bool $noInteraction, bool $verbose, bool $reverseDefectList, bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions, bool $forceCoversAnnotation, ?string $bootstrap, bool $processIsolation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnError, bool $stopOnFailure, bool $stopOnWarning, bool $stopOnIncomplete, bool $stopOnRisky, bool $stopOnSkipped, ?string $extensionsDirectory, ?string $testSuiteLoaderClass, ?string $testSuiteLoaderFile, ?string $printerClass, ?string $printerFile, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutResourceUsageDuringSmallTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutTodoAnnotatedTests, bool $beStrictAboutCoversAnnotation, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticAttributes, bool $registerMockObjectsFromTestArgumentsRecursively, bool $conflictBetweenPrinterClassAndTestdox)
279
    {
280
        $this->cacheResult                                     = $cacheResult;
281
        $this->cacheResultFile                                 = $cacheResultFile;
282
        $this->columns                                         = $columns;
283
        $this->colors                                          = $colors;
284
        $this->stderr                                          = $stderr;
285
        $this->noInteraction                                   = $noInteraction;
286
        $this->verbose                                         = $verbose;
287
        $this->reverseDefectList                               = $reverseDefectList;
288
        $this->convertDeprecationsToExceptions                 = $convertDeprecationsToExceptions;
289
        $this->convertErrorsToExceptions                       = $convertErrorsToExceptions;
290
        $this->convertNoticesToExceptions                      = $convertNoticesToExceptions;
291
        $this->convertWarningsToExceptions                     = $convertWarningsToExceptions;
292
        $this->forceCoversAnnotation                           = $forceCoversAnnotation;
293
        $this->bootstrap                                       = $bootstrap;
294
        $this->processIsolation                                = $processIsolation;
295
        $this->failOnEmptyTestSuite                            = $failOnEmptyTestSuite;
296
        $this->failOnIncomplete                                = $failOnIncomplete;
297
        $this->failOnRisky                                     = $failOnRisky;
298
        $this->failOnSkipped                                   = $failOnSkipped;
299
        $this->failOnWarning                                   = $failOnWarning;
300
        $this->stopOnDefect                                    = $stopOnDefect;
301
        $this->stopOnError                                     = $stopOnError;
302
        $this->stopOnFailure                                   = $stopOnFailure;
303
        $this->stopOnWarning                                   = $stopOnWarning;
304
        $this->stopOnIncomplete                                = $stopOnIncomplete;
305
        $this->stopOnRisky                                     = $stopOnRisky;
306
        $this->stopOnSkipped                                   = $stopOnSkipped;
307
        $this->extensionsDirectory                             = $extensionsDirectory;
308
        $this->testSuiteLoaderClass                            = $testSuiteLoaderClass;
309
        $this->testSuiteLoaderFile                             = $testSuiteLoaderFile;
310
        $this->printerClass                                    = $printerClass;
311
        $this->printerFile                                     = $printerFile;
312
        $this->beStrictAboutChangesToGlobalState               = $beStrictAboutChangesToGlobalState;
313
        $this->beStrictAboutOutputDuringTests                  = $beStrictAboutOutputDuringTests;
314
        $this->beStrictAboutResourceUsageDuringSmallTests      = $beStrictAboutResourceUsageDuringSmallTests;
315
        $this->beStrictAboutTestsThatDoNotTestAnything         = $beStrictAboutTestsThatDoNotTestAnything;
316
        $this->beStrictAboutTodoAnnotatedTests                 = $beStrictAboutTodoAnnotatedTests;
317
        $this->beStrictAboutCoversAnnotation                   = $beStrictAboutCoversAnnotation;
318
        $this->enforceTimeLimit                                = $enforceTimeLimit;
319
        $this->defaultTimeLimit                                = $defaultTimeLimit;
320
        $this->timeoutForSmallTests                            = $timeoutForSmallTests;
321
        $this->timeoutForMediumTests                           = $timeoutForMediumTests;
322
        $this->timeoutForLargeTests                            = $timeoutForLargeTests;
323
        $this->defaultTestSuite                                = $defaultTestSuite;
324
        $this->executionOrder                                  = $executionOrder;
325
        $this->resolveDependencies                             = $resolveDependencies;
326
        $this->defectsFirst                                    = $defectsFirst;
327
        $this->backupGlobals                                   = $backupGlobals;
328
        $this->backupStaticAttributes                          = $backupStaticAttributes;
329
        $this->registerMockObjectsFromTestArgumentsRecursively = $registerMockObjectsFromTestArgumentsRecursively;
330
        $this->conflictBetweenPrinterClassAndTestdox           = $conflictBetweenPrinterClassAndTestdox;
331
    }
332
 
333
    public function cacheResult(): bool
334
    {
335
        return $this->cacheResult;
336
    }
337
 
338
    /**
339
     * @psalm-assert-if-true !null $this->cacheResultFile
340
     */
341
    public function hasCacheResultFile(): bool
342
    {
343
        return $this->cacheResultFile !== null;
344
    }
345
 
346
    /**
347
     * @throws Exception
348
     */
349
    public function cacheResultFile(): string
350
    {
351
        if (!$this->hasCacheResultFile()) {
352
            throw new Exception('Cache result file is not configured');
353
        }
354
 
355
        return (string) $this->cacheResultFile;
356
    }
357
 
358
    public function columns()
359
    {
360
        return $this->columns;
361
    }
362
 
363
    public function colors(): string
364
    {
365
        return $this->colors;
366
    }
367
 
368
    public function stderr(): bool
369
    {
370
        return $this->stderr;
371
    }
372
 
373
    public function noInteraction(): bool
374
    {
375
        return $this->noInteraction;
376
    }
377
 
378
    public function verbose(): bool
379
    {
380
        return $this->verbose;
381
    }
382
 
383
    public function reverseDefectList(): bool
384
    {
385
        return $this->reverseDefectList;
386
    }
387
 
388
    public function convertDeprecationsToExceptions(): bool
389
    {
390
        return $this->convertDeprecationsToExceptions;
391
    }
392
 
393
    public function convertErrorsToExceptions(): bool
394
    {
395
        return $this->convertErrorsToExceptions;
396
    }
397
 
398
    public function convertNoticesToExceptions(): bool
399
    {
400
        return $this->convertNoticesToExceptions;
401
    }
402
 
403
    public function convertWarningsToExceptions(): bool
404
    {
405
        return $this->convertWarningsToExceptions;
406
    }
407
 
408
    public function forceCoversAnnotation(): bool
409
    {
410
        return $this->forceCoversAnnotation;
411
    }
412
 
413
    /**
414
     * @psalm-assert-if-true !null $this->bootstrap
415
     */
416
    public function hasBootstrap(): bool
417
    {
418
        return $this->bootstrap !== null;
419
    }
420
 
421
    /**
422
     * @throws Exception
423
     */
424
    public function bootstrap(): string
425
    {
426
        if (!$this->hasBootstrap()) {
427
            throw new Exception('Bootstrap script is not configured');
428
        }
429
 
430
        return (string) $this->bootstrap;
431
    }
432
 
433
    public function processIsolation(): bool
434
    {
435
        return $this->processIsolation;
436
    }
437
 
438
    public function failOnEmptyTestSuite(): bool
439
    {
440
        return $this->failOnEmptyTestSuite;
441
    }
442
 
443
    public function failOnIncomplete(): bool
444
    {
445
        return $this->failOnIncomplete;
446
    }
447
 
448
    public function failOnRisky(): bool
449
    {
450
        return $this->failOnRisky;
451
    }
452
 
453
    public function failOnSkipped(): bool
454
    {
455
        return $this->failOnSkipped;
456
    }
457
 
458
    public function failOnWarning(): bool
459
    {
460
        return $this->failOnWarning;
461
    }
462
 
463
    public function stopOnDefect(): bool
464
    {
465
        return $this->stopOnDefect;
466
    }
467
 
468
    public function stopOnError(): bool
469
    {
470
        return $this->stopOnError;
471
    }
472
 
473
    public function stopOnFailure(): bool
474
    {
475
        return $this->stopOnFailure;
476
    }
477
 
478
    public function stopOnWarning(): bool
479
    {
480
        return $this->stopOnWarning;
481
    }
482
 
483
    public function stopOnIncomplete(): bool
484
    {
485
        return $this->stopOnIncomplete;
486
    }
487
 
488
    public function stopOnRisky(): bool
489
    {
490
        return $this->stopOnRisky;
491
    }
492
 
493
    public function stopOnSkipped(): bool
494
    {
495
        return $this->stopOnSkipped;
496
    }
497
 
498
    /**
499
     * @psalm-assert-if-true !null $this->extensionsDirectory
500
     */
501
    public function hasExtensionsDirectory(): bool
502
    {
503
        return $this->extensionsDirectory !== null;
504
    }
505
 
506
    /**
507
     * @throws Exception
508
     */
509
    public function extensionsDirectory(): string
510
    {
511
        if (!$this->hasExtensionsDirectory()) {
512
            throw new Exception('Extensions directory is not configured');
513
        }
514
 
515
        return (string) $this->extensionsDirectory;
516
    }
517
 
518
    /**
519
     * @psalm-assert-if-true !null $this->testSuiteLoaderClass
520
     *
521
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
522
     */
523
    public function hasTestSuiteLoaderClass(): bool
524
    {
525
        return $this->testSuiteLoaderClass !== null;
526
    }
527
 
528
    /**
529
     * @throws Exception
530
     *
531
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
532
     */
533
    public function testSuiteLoaderClass(): string
534
    {
535
        if (!$this->hasTestSuiteLoaderClass()) {
536
            throw new Exception('TestSuiteLoader class is not configured');
537
        }
538
 
539
        return (string) $this->testSuiteLoaderClass;
540
    }
541
 
542
    /**
543
     * @psalm-assert-if-true !null $this->testSuiteLoaderFile
544
     *
545
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
546
     */
547
    public function hasTestSuiteLoaderFile(): bool
548
    {
549
        return $this->testSuiteLoaderFile !== null;
550
    }
551
 
552
    /**
553
     * @throws Exception
554
     *
555
     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
556
     */
557
    public function testSuiteLoaderFile(): string
558
    {
559
        if (!$this->hasTestSuiteLoaderFile()) {
560
            throw new Exception('TestSuiteLoader sourcecode file is not configured');
561
        }
562
 
563
        return (string) $this->testSuiteLoaderFile;
564
    }
565
 
566
    /**
567
     * @psalm-assert-if-true !null $this->printerClass
568
     */
569
    public function hasPrinterClass(): bool
570
    {
571
        return $this->printerClass !== null;
572
    }
573
 
574
    /**
575
     * @throws Exception
576
     */
577
    public function printerClass(): string
578
    {
579
        if (!$this->hasPrinterClass()) {
580
            throw new Exception('ResultPrinter class is not configured');
581
        }
582
 
583
        return (string) $this->printerClass;
584
    }
585
 
586
    /**
587
     * @psalm-assert-if-true !null $this->printerFile
588
     */
589
    public function hasPrinterFile(): bool
590
    {
591
        return $this->printerFile !== null;
592
    }
593
 
594
    /**
595
     * @throws Exception
596
     */
597
    public function printerFile(): string
598
    {
599
        if (!$this->hasPrinterFile()) {
600
            throw new Exception('ResultPrinter sourcecode file is not configured');
601
        }
602
 
603
        return (string) $this->printerFile;
604
    }
605
 
606
    public function beStrictAboutChangesToGlobalState(): bool
607
    {
608
        return $this->beStrictAboutChangesToGlobalState;
609
    }
610
 
611
    public function beStrictAboutOutputDuringTests(): bool
612
    {
613
        return $this->beStrictAboutOutputDuringTests;
614
    }
615
 
616
    public function beStrictAboutResourceUsageDuringSmallTests(): bool
617
    {
618
        return $this->beStrictAboutResourceUsageDuringSmallTests;
619
    }
620
 
621
    public function beStrictAboutTestsThatDoNotTestAnything(): bool
622
    {
623
        return $this->beStrictAboutTestsThatDoNotTestAnything;
624
    }
625
 
626
    public function beStrictAboutTodoAnnotatedTests(): bool
627
    {
628
        return $this->beStrictAboutTodoAnnotatedTests;
629
    }
630
 
631
    public function beStrictAboutCoversAnnotation(): bool
632
    {
633
        return $this->beStrictAboutCoversAnnotation;
634
    }
635
 
636
    public function enforceTimeLimit(): bool
637
    {
638
        return $this->enforceTimeLimit;
639
    }
640
 
641
    public function defaultTimeLimit(): int
642
    {
643
        return $this->defaultTimeLimit;
644
    }
645
 
646
    public function timeoutForSmallTests(): int
647
    {
648
        return $this->timeoutForSmallTests;
649
    }
650
 
651
    public function timeoutForMediumTests(): int
652
    {
653
        return $this->timeoutForMediumTests;
654
    }
655
 
656
    public function timeoutForLargeTests(): int
657
    {
658
        return $this->timeoutForLargeTests;
659
    }
660
 
661
    /**
662
     * @psalm-assert-if-true !null $this->defaultTestSuite
663
     */
664
    public function hasDefaultTestSuite(): bool
665
    {
666
        return $this->defaultTestSuite !== null;
667
    }
668
 
669
    /**
670
     * @throws Exception
671
     */
672
    public function defaultTestSuite(): string
673
    {
674
        if (!$this->hasDefaultTestSuite()) {
675
            throw new Exception('Default test suite is not configured');
676
        }
677
 
678
        return (string) $this->defaultTestSuite;
679
    }
680
 
681
    public function executionOrder(): int
682
    {
683
        return $this->executionOrder;
684
    }
685
 
686
    public function resolveDependencies(): bool
687
    {
688
        return $this->resolveDependencies;
689
    }
690
 
691
    public function defectsFirst(): bool
692
    {
693
        return $this->defectsFirst;
694
    }
695
 
696
    public function backupGlobals(): bool
697
    {
698
        return $this->backupGlobals;
699
    }
700
 
701
    public function backupStaticAttributes(): bool
702
    {
703
        return $this->backupStaticAttributes;
704
    }
705
 
706
    public function registerMockObjectsFromTestArgumentsRecursively(): bool
707
    {
708
        return $this->registerMockObjectsFromTestArgumentsRecursively;
709
    }
710
 
711
    public function conflictBetweenPrinterClassAndTestdox(): bool
712
    {
713
        return $this->conflictBetweenPrinterClassAndTestdox;
714
    }
715
}