Skip to content

Instantly share code, notes, and snippets.

@alexhouse
Created February 13, 2014 15:55
Show Gist options
  • Save alexhouse/8977684 to your computer and use it in GitHub Desktop.
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
<?php
require_once 'Model.php';
class BraceTest extends PHPUnit_Framework_TestCase {
public function testBraces()
{
$params = array(1, 2, 3);
Model::load_something($params);
}
}
<?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