/** * @covers ::check */ public function testDoesNotExecuteCallbackIfWrappedContractsDisabled() { // ---------------------------------------------------------------- // setup your test $executed = false; $callback = function () use(&$executed) { $executed = true; }; WrappedContracts::disable(); // ---------------------------------------------------------------- // perform the change RunPreconditions::check($callback, []); // ---------------------------------------------------------------- // test the results $this->assertFalse($executed); }
/** * @covers ::check */ public function testCanCheckIfWrappedContractsAreEnabled() { // ---------------------------------------------------------------- // setup your test WrappedContracts::disable(); $this->assertFalse(WrappedContracts::check()); // ---------------------------------------------------------------- // perform the change WrappedContracts::enable(); // ---------------------------------------------------------------- // test the results $this->assertTrue(WrappedContracts::check()); }