Created
February 13, 2014 15:55
-
-
Save alexhouse/8977684 to your computer and use it in GitHub Desktop.
XDebug issue with code coverage; PHP 5.4.25, XDebug 2.2.3, PHPUnit 3.7.31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Model.php'; | |
class BraceTest extends PHPUnit_Framework_TestCase { | |
public function testBraces() | |
{ | |
$params = array(1, 2, 3); | |
Model::load_something($params); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model { | |
public static function load_something($params) | |
{ | |
foreach ( $params as $param ) | |
{ | |
$get_something = Model::get_something($param); | |
if ( $get_something ) | |
{ | |
if ( $get_something['time'] == $param ) | |
{ | |
$set_something = 'something'; | |
break; | |
} | |
} // this line is ignored | |
} | |
return $set_something; | |
} | |
public static function get_something($param) | |
{ | |
return array( | |
'time' => $param | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment