-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Extend route enhancer test framework
* introduce `routeParameter` variable (default `{value}`) * introduce ExceptionExpectation applicable in test cases * adjust TestSet::getSingleApplicable($type) to consider ApplicableConjunction as well * adjust configuration/declaration merges Resolves: #90153 Releases: master, 9.5 Change-Id: Ic0e84ac91bb3a9f7a1d8b004052b8d93867a39e3 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63005 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Oliver Hader <oliver.hader@typo3.org> Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
- Loading branch information
Showing
9 changed files
with
213 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
.../sysext/frontend/Tests/Functional/SiteHandling/Framework/Builder/ExceptionExpectation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
namespace TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
class ExceptionExpectation implements Applicable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $identifier; | ||
|
||
/** | ||
* @var string|null | ||
*/ | ||
private $className; | ||
|
||
/** | ||
* @var int|null | ||
*/ | ||
private $code; | ||
|
||
/** | ||
* @var string|null | ||
*/ | ||
private $message; | ||
|
||
public static function create(string $identifier): self | ||
{ | ||
return new static($identifier); | ||
} | ||
|
||
private function __construct(string $identifier) | ||
{ | ||
$this->identifier = $identifier; | ||
} | ||
|
||
public function withClassName(string $className): self | ||
{ | ||
$target = clone $this; | ||
$target->className = $className; | ||
return $target; | ||
} | ||
|
||
public function withCode(int $code): self | ||
{ | ||
$target = clone $this; | ||
$target->code = $code; | ||
return $target; | ||
} | ||
|
||
public function withMessage(string $message): self | ||
{ | ||
$target = clone $this; | ||
$target->message = $message; | ||
return $target; | ||
} | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getClassName(): ?string | ||
{ | ||
return $this->className; | ||
} | ||
|
||
/** | ||
* @return int|null | ||
*/ | ||
public function getCode(): ?int | ||
{ | ||
return $this->code; | ||
} | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getMessage(): ?string | ||
{ | ||
return $this->message; | ||
} | ||
|
||
public function describe(): string | ||
{ | ||
return sprintf('Exception %s', $this->identifier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.