Example #1
0
 /**
  * @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");
     }
 }
Example #2
0
 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());
 }
Example #3
0
 /**
  * Just log a line.
  *
  * @param string String to log
  * @return void
  * @see phpRack_Package_Php::lint() and many other methods
  */
 protected function _log($message)
 {
     // pass it to sprintf
     if (func_num_args() > 1) {
         $args = func_get_args();
         $message = call_user_func_array('sprintf', array_merge(array($message), array_slice($args, 1)));
     }
     $this->_result->addLog($message);
 }
Example #4
0
 /**
  * @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());
 }
Example #5
0
 /**
  * @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');
 }
Example #6
0
 /**
  * Just log a line
  *
  * @param string String to log
  * @return void
  * @see phpRack_Package_Php::lint() and many other methods
  */
 protected function _log($log)
 {
     $this->_result->addLog($log);
 }
Example #7
0
 public function testInvalidResponseCode()
 {
     $this->_package->url('http://www.google.com/some_wrong_link')->responseCode('/^[2|3]/');
     $this->assertFalse($this->_result->wasSuccessful());
 }
Example #8
0
 /**
  * Tests if lint does not check folders.
  */
 public function testLintWithFolder()
 {
     $this->_package->lint($this->_testFilesDir . '/php/empty');
     $this->assertTrue($this->_result->wasSuccessful());
 }
Example #9
0
 /**
  * @dataProvider testAtLeastProvider
  */
 public function testAtLeast($data)
 {
     $this->_package->ini('memory_limit')->atLeast($data[0]);
     $this->{$data[1]}($this->_result->wasSuccessful());
 }
Example #10
0
 /**
  * Tests direct fail function.
  */
 public function testFailure()
 {
     $this->_package->fail("Failed test");
     $this->assertFalse($this->_result->wasSuccessful());
 }