Skip to content

Commit

Permalink
Fix getFullName method in CestProvider.php (fixes #97)
Browse files Browse the repository at this point in the history
  • Loading branch information
nixdrey authored May 11, 2022
1 parent c812ab3 commit 8ba63e1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Internal/CestProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ public function getDescriptionHtml(): ?string
return null;
}

/**
* @psalm-suppress MixedOperand
* @psalm-suppress MixedArgument
*/
public function getFullName(): ?string
{
return null;
return get_class($this->test->getTestClass()) . "::" . $this->test->getTestMethod();
}
}
20 changes: 20 additions & 0 deletions test/codeception/unit/CestProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace Qameta\Allure\Codeception\Test\Unit;

use Codeception\Test\Cest;
use Codeception\Test\Unit;
use Qameta\Allure\Codeception\Internal\CestProvider;

class CestProviderTest extends Unit
{
public function testFullName(): void
{
$cest = new Cest($this, 'a', 'b');
$cestProvider = new CestProvider($cest);

$this->assertSame(__CLASS__ . '::' . 'a', $cestProvider->getFullName());
}
}

0 comments on commit 8ba63e1

Please sign in to comment.