Skip to content

Can't overwrite WebTestCase $env static property #595

@mikysan

Description

@mikysan

Preconditions

  1. PHP 8.0
  2. Symfony 5.4
  3. liip/functional-test-bundle 4.5

Steps to reproduce

  1. rename Symfony test environment to testing
  2. create a test like following
namespace App\Tests;

use Liip\FunctionalTestBundle\Test\WebTestCase;

class FunctionalTestCase extends WebTestCase
{
    protected static $env = 'testing';

    public function testFoo()
    {
        $this->assertTrue(true);
    }
}

Expected result

The test should pass

Actual result

test fail with You have requested a non-existent parameter "secret". error message.

Proposed solution

Replace self::$env with static::$env in related files (see: https://github.com/liip/LiipFunctionalTestBundle/pull/593/files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions