/** * @dataProvider providerFunctionNames */ public function testAtLeast($name, $exists) { $this->_package->fnExists($name); if (!is_null($exists)) { $this->assertEquals($exists, $this->_result->wasSuccessful(), "Function '{$name}' returned invalid result"); } }
public function testIsOpen() { try { $this->_package->isOpen(80, 'google.com'); $this->assertTrue($this->_result->wasSuccessful()); } catch (Exception $e) { $this->_log($e); $this->markTestIncomplete(); } $this->_package->isOpen(9999); $this->assertFalse($this->_result->wasSuccessful()); }
/** * @covers phpRack_Package_Php::atLeast * @covers phpRack_Package_Php::_sizeFormat */ public function testIniGigaPrefixMultiplier() { ini_set('default_socket_timeout', '60G'); $this->_package->ini('default_socket_timeout')->atLeast(60 * phpRack_Package_Php::SIZE_FORMAT ^ 3); $this->assertTrue($this->_result->wasSuccessful()); }
/** * @covers phpRack_Package_Php_Version::atLeast */ public function testIsNewer() { $this->_package->version->atLeast('9.5.5'); $this->assertFalse($this->_result->wasSuccessful(), '5.4 < 9.5.5'); }
public function testInvalidResponseCode() { $this->_package->url('http://www.google.com/some_wrong_link')->responseCode('/^[2|3]/'); $this->assertFalse($this->_result->wasSuccessful()); }
/** * Tests if lint does not check folders. */ public function testLintWithFolder() { $this->_package->lint($this->_testFilesDir . '/php/empty'); $this->assertTrue($this->_result->wasSuccessful()); }
/** * @dataProvider testAtLeastProvider */ public function testAtLeast($data) { $this->_package->ini('memory_limit')->atLeast($data[0]); $this->{$data[1]}($this->_result->wasSuccessful()); }
/** * Tests direct fail function. */ public function testFailure() { $this->_package->fail("Failed test"); $this->assertFalse($this->_result->wasSuccessful()); }