Skip to content

Use of undefined constant BASEPATH #1439

Description

@NathanVss

Hello,

When I activate the coverage when running my phpunit tests, I got this error ( without details .. ):

vendor/bin/phpunit --testsuite=app --debug
PHPUnit 7.4.3 by Sebastian Bergmann and contributors.

Test 'Tests\App\Entity\BaseTest::testSettings' started
Use of undefined constant BASEPATH - assumed 'BASEPATH'

The error doesn't occur when disabling coverage.

Phpunit file:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/_support/_bootstrap.php"
         backupGlobals="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         stopOnError="false"
         stopOnFailure="false"
         stopOnIncomplete="false"
         stopOnSkipped="false">
    <testsuites>
        <testsuite name="app">
            <directory>tests/application</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">application</directory>
        </whitelist>
    </filter>

    <logging>
        <log type="coverage-clover" target="build/logs/clover.xml"/>
    </logging>
</phpunit>

Context

  • OS: MacOS
  • Web server: Apache2.4
  • PHP version: 7.1

Thanks all !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for infoIssues or pull requests that need further clarification from the author

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions