thomasesmith / php-vw-car-net

An unofficial PHP wrapper for the VW Car-Net API
12 stars 3 forks source link

Failed opening required vendor/autoload.php #3

Closed mtbsteve closed 4 years ago

mtbsteve commented 4 years ago

Thomas, me again. I am getting the following error once I try to execute the AuthentificationTest.php script:

  | <b>Warning</b>:  require_once(vendor/autoload.php): failed to open stream: No such file or directory in <b>/home/stephan/GitHub/vendor/thomasesmith/php-vw-car-net/tests/AuthenticationTest.php</b> on line <b>5</b><br />
  | <br />
  | <b>Fatal error</b>:  require_once(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in <b>/home/stephan/GitHub/vendor/thomasesmith/php-vw-car-net/tests/AuthenticationTest.php</b> on line <b>5</b><br />

I use the XAMPP - Apache webserver and I Installed your code with composer as shown in the readme. The file vendor/autoload.php exists. The only modification I made it to include my carnet credentials into the _config.example.php file. Any idea what I am doing wrong here?

thomasesmith commented 4 years ago

Actually, this one's my fault. I will fix this in 0.2.4. The test files are looking in the wrong place for the autoload.php file.

For now, you can change that line 5 in both the *Test.php files to

require_once __DIR__ . '/../vendor/autoload.php';

then try running vendor/bin/phpunit vendor/thomasesmith/php-vw-car-net/tests again from the root folder.

mtbsteve commented 4 years ago

Thanks - now I am running into the next issue:

Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in /home/stephan/GitHub/vendor/thomasesmith/php-vw-car-net/tests/AuthenticationTest.php:20 Stack trace: #0 {main} thrown in /home/stephan/GitHub/vendor/thomasesmith/php-vw-car-net/tests/AuthenticationTest.php on line 20

I could not find the definition of the class „TestCase“