‪TYPO3CMS  ‪main
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 {
22  private string ‪$identifier;
23  private ?string ‪$className;
24  private ?int ‪$code;
25  private ?string ‪$message;
26 
27  public static function ‪create(string ‪$identifier): self
28  {
29  return new static(‪$identifier);
30  }
31 
32  private function ‪__construct(string ‪$identifier)
33  {
34  $this->identifier = ‪$identifier;
35  }
36 
37  public function ‪withClassName(string ‪$className): self
38  {
39  $target = clone $this;
40  $target->className = ‪$className;
41  return $target;
42  }
43 
44  public function ‪withCode(int ‪$code): self
45  {
46  $target = clone $this;
47  $target->code = ‪$code;
48  return $target;
49  }
50 
51  public function ‪withMessage(string ‪$message): self
52  {
53  $target = clone $this;
54  $target->message = ‪$message;
55  return $target;
56  }
57 
58  public function ‪getClassName(): ?string
59  {
60  return ‪$this->className;
61  }
62 
63  public function ‪getCode(): ?int
64  {
65  return ‪$this->code;
66  }
67 
68  public function ‪getMessage(): ?string
69  {
70  return ‪$this->message;
71  }
72 
73  public function ‪describe(): string
74  {
75  return sprintf('Exception %s', $this->identifier);
76  }
77 }
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\create
‪static create(string $identifier)
Definition: ExceptionExpectation.php:27
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withMessage
‪withMessage(string $message)
Definition: ExceptionExpectation.php:51
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$message
‪string $message
Definition: ExceptionExpectation.php:25
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\__construct
‪__construct(string $identifier)
Definition: ExceptionExpectation.php:32
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withCode
‪withCode(int $code)
Definition: ExceptionExpectation.php:44
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getClassName
‪getClassName()
Definition: ExceptionExpectation.php:58
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getCode
‪getCode()
Definition: ExceptionExpectation.php:63
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\getMessage
‪getMessage()
Definition: ExceptionExpectation.php:68
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\withClassName
‪withClassName(string $className)
Definition: ExceptionExpectation.php:37
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$code
‪int $code
Definition: ExceptionExpectation.php:24
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$className
‪string $className
Definition: ExceptionExpectation.php:23
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\Applicable
Definition: Applicable.php:21
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ExceptionExpectation\$identifier
‪string $identifier
Definition: ExceptionExpectation.php:22
‪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:73
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder
Definition: Applicable.php:18