Apiato: phpunit can't find any tests: "No tests executed!"

Created on 3 Apr 2017  路  6Comments  路  Source: apiato/apiato

Hi, I have just installed apiato in laragon (many thanks for the help!). The tutorial example works now.

However phpunit can't find any tests. There are several Tests-folders with php-files in my fresh installed apiato-project, but I get this message (I didn't write any own tests so far):

c:\laragon\www\apiato (master)
位 phpunit
PHPUnit 6.0.0 by Sebastian Bergmann and contributors.



Time: 701 ms, Memory: 6.00MB

No tests executed!

What am I doing wrong?

PS:

phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Containers Tests">
            <directory suffix="Test.php">./app/Containers</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="API_FULL_URL"        value="http://api.apiato.dev"/>

        <env name="APP_ENV"             value="testing"/>
        <env name="CACHE_DRIVER"        value="array"/>
        <env name="SESSION_DRIVER"      value="array"/>
        <env name="QUEUE_DRIVER"        value="sync"/>

        <env name="DB_CONNECTION"       value="testing_sqlite_in_memory"/>
        <env name="DB_HOST"             value="127.0.0.1"/>
        <env name="DB_PORT"             value="3306"/>
        <env name="DB_NAME"             value="apiato"/>
        <env name="DB_USERNAME"         value="root"/>
        <env name="DB_PASSWORD"         value=""/>
    </php>
</phpunit>
Help

Most helpful comment

I need to call phpunit with this path: vendor\bin\phpunit

All 6 comments

That's wired!

Should "phpunit" command run and show all default-tests without any adjustment after successful apiato installation? Which files should I post here in order to check for the proper configuration?

It normally run out of the box after successful installation. I guess in your cases there's something related to the setup (how and where you installed PHPUnit). Not sure which phpunit executable you are running and where is it trying locate the tests from. You need to use the vendor version, this should read that phpunit.xml file which points to your tests (Containers Tests Testsuite).

I don't think this problem is caused by apiato, can you try installing any project (maybe laravel dev) and running its tests to see if it works.

I do recommend trying to use http://laradock.io/ as alternative to your current environment. It should be easier to setup and use but I don't guarantee that! however I do guarantee full compatibility with apiato, since I'm the creator of both projects :P

I am sorry, but I have no idea how to setup/install Laradock. Do I need to install docker-compose, nginx, mysql and other stuff before using this command: "docker-compose up -d nginx mysql redis beanstalkd" (http://laradock.io/introduction/) ? I make an internship and don't have an admin-account for installing software. I only have Laragon v. 2.2.2 at my disposal. I was told to test/become acquainted with Apiato. What am I to do?
PS: updated phpunit but it doesn't help:

c:\laragon\www\apiato (master)
位 phpunit --version
PHPUnit 6.1.0 by Sebastian Bergmann and contributors.

c:\laragon\www\apiato (master)
位 phpunit
PHPUnit 6.1.0 by Sebastian Bergmann and contributors.



Time: 696 ms, Memory: 6.00MB

No tests executed!

I maked a new apiato projekt again with a new database "apiato". Then I followed your tutorial and mentioned I can't execute two commands:
By the way I get this two errors:

c:\laragon\www\apiato (master)
位 php artisan jwt:generate


  [Symfony\Component\Console\Exception\CommandNotFoundException]
  There are no commands defined in the "jwt" namespace.

c:\laragon\www\apiato (master)
位 php artisan apidoc::generate


  [Symfony\Component\Console\Exception\CommandNotFoundException]
  There are no commands defined in the "apidoc:" namespace.

I created a new apiato projekt again with a new database "apiato". Then I followed your tutorial and noticed I can't execute two commands.

Can it be related to my issue? However I can open this url http://apiato.dev/ and I see: "apiato
(Porto SAP)" in my browser. Project seems to work.

I need to call phpunit with this path: vendor\bin\phpunit

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deviouspk picture deviouspk  路  6Comments

muhsenmaqsudi picture muhsenmaqsudi  路  7Comments

lukaszduda picture lukaszduda  路  5Comments

nmrgt picture nmrgt  路  7Comments

san4io picture san4io  路  7Comments