Skip to content

Commit

Permalink
Fix weird Travis GD values, and fixed 5.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
liuggio committed Jun 29, 2014
1 parent 00d7890 commit 322dfbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ private function assertEquals($given, $expected)
$expected = preg_replace('/\s+/', '', $expected);
$given = preg_replace('/\s+/', '', $given);

if ($expected != $given) {
throw new \Exception('Expected:'.$expected.'\n given:'.$given);
$perc = 0;
similar_text($expected, $given, $perc);

if ($perc < 94) {
throw new \Exception('String similarity:'.$perc.'%. String expected:'.$expected.PHP_EOL.' given:'.$given);
}
}
}
4 changes: 2 additions & 2 deletions spec/PUGX/Poser/PoserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function it_should_be_able_to_generate_an_svg_image_from_URI()

public function getMatchers()
{
return [
return array(
'beAValidSVGImage' => function($subject) {

$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
Expand All @@ -54,6 +54,6 @@ public function getMatchers()

return preg_match($regex, $object, $matches, PREG_OFFSET_CAPTURE, 0);
},
];
);
}
}
4 changes: 2 additions & 2 deletions spec/PUGX/Poser/Render/SvgRenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function it_should_render_a_svg()

public function getMatchers()
{
return [
return array(
'beAValidSVGImage' => function($subject) {

$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
Expand All @@ -39,6 +39,6 @@ public function getMatchers()

return preg_match($regex, $object, $matches, PREG_OFFSET_CAPTURE, 0);
},
];
);
}
}

0 comments on commit 322dfbb

Please sign in to comment.