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\Framework;
11
 
12
/**
13
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
14
 */
15
final class WarningTestCase extends TestCase
16
{
17
    /**
18
     * @var bool
19
     */
20
    protected $backupGlobals = false;
21
 
22
    /**
23
     * @var bool
24
     */
25
    protected $backupStaticAttributes = false;
26
 
27
    /**
28
     * @var bool
29
     */
30
    protected $runTestInSeparateProcess = false;
31
 
32
    /**
33
     * @var string
34
     */
35
    private $message;
36
 
37
    public function __construct(string $message = '')
38
    {
39
        $this->message = $message;
40
 
41
        parent::__construct('Warning');
42
    }
43
 
44
    public function getMessage(): string
45
    {
46
        return $this->message;
47
    }
48
 
49
    /**
50
     * Returns a string representation of the test case.
51
     */
52
    public function toString(): string
53
    {
54
        return 'Warning';
55
    }
56
 
57
    /**
58
     * @throws Exception
59
     *
60
     * @psalm-return never-return
61
     */
62
    protected function runTest(): void
63
    {
64
        throw new Warning($this->message);
65
    }
66
}