Skip to content

Pest integration does not work #1894

@oruborus

Description

@oruborus

Tempest version

2.14

PHP version

8.4

Operating system

Windows

Description

After switching to pestphp/pest at first ".tempest/test_internal_storage/default/current_discovery_strategy" is missing.
After copying the file from ".tempest" and changing the provided "HomeControllerTest" to pests function based aproach, the following assertion in pests backtrace helper fails in Backtrace::testFile(): "assert(array_key_exists(self::FILE, $trace))"

Steps to reproduce

  1. Create a new project: $ composer create-project tempest/app tempestpest
  2. Remove PHPUnit: $ composer remove phpunit/phpunit
  3. Require pest: $ composer require pestphp/pest --dev --with-all-dependencies (confirm allow plugins)
  4. Copy ".tempest/current_discovery_strategy" to ".tempest/test_internal_storage/default/current_discovery_strategy"
  5. Add Pest.php to "./tests":
<?php

declare(strict_types=1);

pest()
    ->extend(Tests\IntegrationTestCase::class) // Note the chaged class-name
    ->in(__DIR__);
  1. Change "./tests/HomeCOntrollerTest.php" to:
<?php

declare(strict_types=1);

namespace Tests;

test('home controller test', function () {
    $this->http
        ->get('/')
        ->assertOk()
        ->assertSee('Tempest');
});
  1. Run $ vendor/bin/pest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions