/** * @covers ::areContractsEnabled */ public function testCanCheckThatContractsAreEnabled() { // ---------------------------------------------------------------- // setup your test ContractChecks::enable(); $this->assertTrue(ContractChecks::areEnabled()); $this->assertTrue(Contracts::areContractsEnabled()); // ---------------------------------------------------------------- // perform the change ContractChecks::disable(); // ---------------------------------------------------------------- // test the results $this->assertFalse(ContractChecks::areEnabled()); $this->assertFalse(Contracts::areContractsEnabled()); }
/** * are the '::requireThat()', '::ensureThat()' and '::checkThat()' methods * enforcing their contacts? * * @return boolean * TRUE if these methods run their contacts * FALSE if these methods skip over their contracts */ public static function areContractsEnabled() { return ContractChecks::areEnabled(); }