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

setUpBeforeClass not called when slice activated #14

Open
SimoneDoc opened this issue Jun 10, 2022 · 0 comments
Open

setUpBeforeClass not called when slice activated #14

SimoneDoc opened this issue Jun 10, 2022 · 0 comments

Comments

@SimoneDoc
Copy link

SimoneDoc commented Jun 10, 2022

If you exec slicer without slices options it works well
vendor/bin/phpunit-slicer --color --configuration configuration.xml

If you use the slices options, the setUpBeforeClass hook was not called and test fails
vendor/bin/phpunit-slicer --color --configuration configuration.xml --slices 1/1

php-slicer 1.0
phpunit/phpunit 7.5.20

TestDummy.php

<?php

use PHPUnit\Framework\TestCase;

class TestDummy extends TestCase
{
    static $called = false;

    public static function setUpBeforeClass()
    {
        parent::setUpBeforeClass();
        self::$called = true;
    }

    public function testSetUpBeforeClassIsCalled()
    {
        $this->assertTrue(self::$called);
    }
}

Configurations.xml

<?xml version="1.0" encoding="UTF-8"?>

<phpunit>

    <testsuites>

        <testsuite name="testsuite-dummy">
            <directory>TestDummy.php</directory>
        </testsuite>

    </testsuites>


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

No branches or pull requests

1 participant