Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Bundle Unit Test with Package
  • I'm creating a new package, and I would like to bundle some unit test with the distribution. So far I have not been able to run the test cases with in the package. Any way to do this?

    This is currently how the structure of my package looks like:
        fuel/app/packages/
        fuel/app/packages/my_package/classes/...
        fuel/app/packages/my_package/config/...
        fuel/app/packages/my_package/test/
        fuel/app/packages/my_package/test/driver
        fuel/app/packages/my_package/test/driver/name.php


    The test class looks like this


    <?php
    /**
     * @group my_package
     */
    class test_driver_name extends TestCase
    {
        public function test_something()
        {
            echo 'hello, test!';
        }
    }


    and this is how I'm calling the unit test using oil


        oil test --group=my_package


    I'm using the default phpunit.xml configuration.

    Thank you.
  • HarroHarro
    Accepted Answer
    According to the phpunit.xml, it looks for

            <testsuite name="packages">
                <directory suffix=".php">../packages/*/tests</directory>
            </testsuite>

    so packages lives one up from the directory the xml is in, and test are in the tests folder of a package (and not in test).
  • You are right! that was my bad.

    It now works Thank you,

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion