Add Initial teamcity support

This commit is contained in:
Oliver
2023-01-08 11:21:08 +01:00
parent 15931e2418
commit 0839c7e127
36 changed files with 1087 additions and 78 deletions

View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Factories\TestCaseMethodFactory;
/**
* @interal
*/
interface AddsAnnotation
{
/**
* Adds annotations to method
*
* @param array<int, string> $annotations
* @return array<int, string>
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array;
}

View File

@ -10,7 +10,7 @@ use Pest\Factories\TestCaseMethodFactory;
/**
* @internal
*/
final class CoversNothing
final class CoversNothing implements AddsAnnotation
{
/**
* Adds annotations regarding the "depends" feature.

View File

@ -10,7 +10,7 @@ use Pest\Support\Str;
/**
* @internal
*/
final class Depends
final class Depends implements AddsAnnotation
{
/**
* Adds annotations regarding the "depends" feature.

View File

@ -9,7 +9,7 @@ use Pest\Factories\TestCaseMethodFactory;
/**
* @internal
*/
final class Groups
final class Groups implements AddsAnnotation
{
/**
* Adds annotations regarding the "groups" feature.

View File

@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Factories\TestCaseMethodFactory;
final class TestDox implements AddsAnnotation
{
/**
* Add metadata via test dox for TeamCity
*
* @param array<int, string> $annotations
* @return array<int, string>
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
{
// First test dox on class overrides the method name.
$annotations[] = "@testdox $method->description";
return $annotations;
}
}