Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with BASE_PATH when running tests inside PHPStorm #115

Closed
mikeerickson opened this issue Jan 28, 2018 · 9 comments
Closed

Issue with BASE_PATH when running tests inside PHPStorm #115

mikeerickson opened this issue Jan 28, 2018 · 9 comments

Comments

@mikeerickson
Copy link

Hey

I am running into the following error when attempting to run my tests while inside PHPStorm (all works fine from CLI) Any chance you know of how I can get around this issue

image

@nunomaduro
Copy link
Member

@mikeerickson Seems like of you have changed your phpunit.xml. Please show me your phpunit.xml.

@mikeerickson
Copy link
Author

Here you go, the only thing added was the printer for my PHPUnitPrettyResultPrinter project.

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutOutputDuringTests="true"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         failOnRisky="true"
         failOnWarning="true"
         processIsolation="false"
         printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer"
         stopOnError="false"
         stopOnFailure="false"
         verbose="true"
>
    <testsuites>
        <testsuite name="Laravel Zero Test Suite">
            <directory suffix="Test.php">./tests/Integration</directory>
        </testsuite>
    </testsuites>
    <listeners>
        <listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
    </listeners>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
</phpunit>

@nunomaduro
Copy link
Member

Show me your bootstrap/autoload.php.

@mikeerickson
Copy link
Author

@nunomaduro I will share it later this evening or tomorrow morning (not w/ computer). Remember, it is ONLY an issue when using PHPStorm test runner, all is fine when running on CLI

@nunomaduro
Copy link
Member

@mikeerickson I believe you didn't specify the correct autoload on your phpstorm configuration.

@mikeerickson
Copy link
Author

peut-être! Je vais jeter un coup d'oeil ce soir

@mikeerickson
Copy link
Author

@nunomaduro Nope, that was not the issue. I have confirmed the correct autoload.php file is used AND I have recreated it for good measure

$ composer dump-autoload

image

@mikeerickson
Copy link
Author

@nunomaduro And, as per your request from earlier, here is the contents of the autoload.php file

<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit724bfcfa6019cb9dfe8d59d77392f010::getLoader();

@mikeerickson
Copy link
Author

@nunomaduro Well, for argument sake, I decided to assign the alternate items (see screenshot) and now it is working as expected

FWIW, I have not had to assign these objects in other projects, but not going to fret that now that things are working

image

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

No branches or pull requests

2 participants