allure-framework / allure-phpunit

Allure integrations for PHP test frameworks: PHPUnit
https://allurereport.org/
Apache License 2.0
60 stars 28 forks source link

Invalid readme example: Attribute class Qameta\Allure\Attribute\Title does not exist #95

Closed fey closed 8 months ago

fey commented 1 year ago

Describe the bug Invalid code example in readme. PHPStan reports `

To Reproduce Add Title attribute. Ex.:

https://github.com/fey/hexlet-sicp/blob/e851609fc332a0b7a2f66055944ac4bd67f04270/tests/Feature/Http/Controllers/HomeControllerTest.php#L8

<?php

namespace Tests\Feature\Http\Controllers;

use Tests\TestCase;
use Qameta\Allure\Attribute\Title;

#[Title("Проверка главной страницы")]
class HomeControllerTest extends TestCase
{
    #[Title("Возможность открытия главной страницы гостем")]
    public function testIndex(): void
    {
        $response = $this->get(route('home'));

        $response->assertOk();
    }

    #[Title("Ссылка для dev-логина не видна")]
    public function testNotSeeDevLogin(): void
    {
        $response = $this->get(route('home'));

        $response->assertDontSee(
            route('auth.dev-login')
        );
    }
}

check code with PHPStan

Expected behavior

PHPStan says its all ok. Test result uploaded to allure instance

Screenshots

image

delatrie commented 8 months ago

Hi! That was an error in README (fixed in #86). The correct attribute to use is DisplayName (see here).