Disabling Tests
Sometimes you might need to disable a test for a variety of reasons. With AsyncUnit you can disable your tests, TestCases, and TestSuites with the Disabled Attribute!
Last updated
Was this helpful?
Sometimes you might need to disable a test for a variety of reasons. With AsyncUnit you can disable your tests, TestCases, and TestSuites with the Disabled Attribute!
Last updated
Was this helpful?
In a complex test suite there might be times where you need to disable tests for a variety of reasons. If you're familiar with PHPUnit their nomenclature is skipped or ignored. In AsyncUnit we consolidate this into one concept; a disabled test. You can disable not only a test but an entire TestCase
or even a whole TestSuite
with the #[Disabled]
attribute!
If you just need to disable a single test simple annotate that method with the #[Disabled]
Attribute!
When disabling a single test any #[BeforeEach]
or #[AfterEach]
hook defined on the TestCase
will not be executed.
Chances are if one test in a TestCase
needs to be disabled so do all the other tests. In those situations you can simply annotate the class with the #[Disabled]
Attribute.
When disabling an entire TestCase
not only are none of the tests executed but none of the hooks associated with that TestCase
are executed either.
If you're utilizing an explicit TestSuite
it might be beneficial to disable all of the TestCase
associated to the TestSuite
. Just like with the TestCase
simply annotate the appropriate class with the #[Disabled]
Attribute!
When disabling a TestSuite
no tests or hooks for the TestSuite
or any of its TestCase
will be invoked!