forked from sebastianbergmann/phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90fb197
commit 3efde16
Showing
18 changed files
with
683 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Framework\Attributes; | ||
|
||
use Attribute; | ||
|
||
/** | ||
* @psalm-immutable | ||
* | ||
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] | ||
final readonly class CoversMethod | ||
{ | ||
/** | ||
* @psalm-var class-string | ||
*/ | ||
private string $className; | ||
|
||
/** | ||
* @psalm-var non-empty-string | ||
*/ | ||
private string $methodName; | ||
|
||
/** | ||
* @psalm-param class-string $className | ||
* @psalm-param non-empty-string $methodName | ||
*/ | ||
public function __construct(string $className, $methodName) | ||
{ | ||
$this->className = $className; | ||
$this->methodName = $methodName; | ||
} | ||
|
||
/** | ||
* @psalm-return class-string | ||
*/ | ||
public function className(): string | ||
{ | ||
return $this->className; | ||
} | ||
|
||
/** | ||
* @psalm-return non-empty-string | ||
*/ | ||
public function methodName(): string | ||
{ | ||
return $this->methodName; | ||
} | ||
} |
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,57 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Framework\Attributes; | ||
|
||
use Attribute; | ||
|
||
/** | ||
* @psalm-immutable | ||
* | ||
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] | ||
final readonly class UsesMethod | ||
{ | ||
/** | ||
* @psalm-var class-string | ||
*/ | ||
private string $className; | ||
|
||
/** | ||
* @psalm-var non-empty-string | ||
*/ | ||
private string $methodName; | ||
|
||
/** | ||
* @psalm-param class-string $className | ||
* @psalm-param non-empty-string $methodName | ||
*/ | ||
public function __construct(string $className, $methodName) | ||
{ | ||
$this->className = $className; | ||
$this->methodName = $methodName; | ||
} | ||
|
||
/** | ||
* @psalm-return class-string | ||
*/ | ||
public function className(): string | ||
{ | ||
return $this->className; | ||
} | ||
|
||
/** | ||
* @psalm-return non-empty-string | ||
*/ | ||
public function methodName(): string | ||
{ | ||
return $this->methodName; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Metadata; | ||
|
||
/** | ||
* @psalm-immutable | ||
* | ||
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
final readonly class CoversMethod extends Metadata | ||
{ | ||
/** | ||
* @psalm-var class-string | ||
*/ | ||
private string $className; | ||
|
||
/** | ||
* @psalm-var non-empty-string | ||
*/ | ||
private string $methodName; | ||
|
||
/** | ||
* @psalm-param 0|1 $level | ||
* @psalm-param class-string $className | ||
* @psalm-param non-empty-string $methodName | ||
*/ | ||
protected function __construct(int $level, string $className, string $methodName) | ||
{ | ||
parent::__construct($level); | ||
|
||
$this->className = $className; | ||
$this->methodName = $methodName; | ||
} | ||
|
||
/** | ||
* @psalm-assert-if-true CoversMethod $this | ||
*/ | ||
public function isCoversMethod(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* @psalm-return class-string | ||
*/ | ||
public function className(): string | ||
{ | ||
return $this->className; | ||
} | ||
|
||
/** | ||
* @psalm-return non-empty-string | ||
*/ | ||
public function methodName(): string | ||
{ | ||
return $this->methodName; | ||
} | ||
|
||
/** | ||
* @psalm-return non-empty-string | ||
* | ||
* @internal This method is not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
public function asStringForCodeUnitMapper(): string | ||
{ | ||
return $this->className . '::' . $this->methodName; | ||
} | ||
} |
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.