‪TYPO3CMS  10.4
ExceptionExpectation.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 {
25  private ‪$identifier;
26 
30  private ‪$className;
31 
35  private ‪$code;
36 
40  private ‪$message;
41 
42  public static function ‪create(string ‪$identifier): self
43  {
44  return new static(‪$identifier);
45  }
46 
47  private function ‪__construct(string ‪$identifier)
48  {
49  $this->identifier = ‪$identifier;
50  }
51 
52  public function ‪withClassName(string ‪$className): self
53  {
54  $target = clone $this;
55  $target->className = ‪$className;
56  return $target;
57  }
58 
59  public function ‪withCode(int ‪$code): self
60  {
61  $target = clone $this;
62  $target->code = ‪$code;
63  return $target;
64  }
65 
66  public function ‪withMessage(string ‪$message): self
67  {
68  $target = clone $this;
69  $target->message = ‪$message;
70  return $target;
71  }
72 
76  public function ‪getClassName(): ?string
77  {
78  return ‪$this->className;
79  }
80 
84  public function ‪getCode(): ?int
85  {
86  return ‪$this->code;
87  }
88 
92  public function ‪getMessage(): ?string
93  {
94  return ‪$this->message;
95  }
96 
97  public function ‪describe(): string
98  {
99  return sprintf('Exception %s', $this->identifier);
100  }
101 }
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\create
‪static create(string $identifier)
Definition: ExceptionExpectation.php:38
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withMessage
‪withMessage(string $message)
Definition: ExceptionExpectation.php:62
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$code
‪int null $code
Definition: ExceptionExpectation.php:32
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\__construct
‪__construct(string $identifier)
Definition: ExceptionExpectation.php:43
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withCode
‪withCode(int $code)
Definition: ExceptionExpectation.php:55
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withClassName
‪withClassName(string $className)
Definition: ExceptionExpectation.php:48
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\Applicable
Definition: Applicable.php:21
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$className
‪string null $className
Definition: ExceptionExpectation.php:28
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getClassName
‪string null getClassName()
Definition: ExceptionExpectation.php:72
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$identifier
‪string $identifier
Definition: ExceptionExpectation.php:24
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getMessage
‪string null getMessage()
Definition: ExceptionExpectation.php:88
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getCode
‪int null getCode()
Definition: ExceptionExpectation.php:80
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation
Definition: ExceptionExpectation.php:21
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\describe
‪describe()
Definition: ExceptionExpectation.php:93
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder
Definition: Applicable.php:18
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$message
‪string null $message
Definition: ExceptionExpectation.php:36