Skip to content

Commit 5edb2ce

Browse files
committed
Issue #7: Trying to fix png image generation on Travis.
1 parent 2fe9c86 commit 5edb2ce

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

spec/drupol/phptree/Exporter/GraphSpec.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ public function getMatchers(): array
2525
'haveSameGraphImageFile' => function ($subject, $key) {
2626
$left = (new GraphViz())->setFormat('png')->createImageFile($subject);
2727

28+
$left = file_get_contents($left);
29+
print_r('file_get_contents($left)');
30+
print_r($left);
31+
print_r(sha1($left));
32+
33+
print_r('right');
34+
print_r(file_get_contents($key));
35+
print_r(sha1(file_get_contents($key)));
36+
2837
return \sha1(\file_get_contents($left)) === \sha1(\file_get_contents($key));
2938
},
3039
];
@@ -52,7 +61,7 @@ public function it_can_generate_a_graph()
5261

5362
$this
5463
->export($tree)
55-
->shouldHaveSameGraphImageFile('tests/fixtures/Exporter/GraphSpec1.png');
64+
->shouldHaveSameGraphImageFile($_SERVER['PWD'] . '/tests/fixtures/Exporter/GraphSpec1.png');
5665
}
5766

5867
public function it_is_initializable()

0 commit comments

Comments
 (0)