File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
tests/phpDocumentor/GraphViz/Test Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -358,21 +358,29 @@ public function test__toString()
358
358
{
359
359
$ graph = Graph::create ('My First Graph ' );
360
360
$ this ->assertSame (
361
- ( string ) $ graph ,
362
- ( 'digraph "My First Graph" { ' . PHP_EOL . PHP_EOL . '} ' )
361
+ $ this -> normalizeLineEndings ( ( string ) $ graph ) ,
362
+ $ this -> normalizeLineEndings ( ( 'digraph "My First Graph" { ' . PHP_EOL . PHP_EOL . '} ' ) )
363
363
);
364
364
365
365
$ graph ->setLabel ('PigeonPost ' );
366
366
$ this ->assertSame (
367
- ( string ) $ graph ,
368
- ( 'digraph "My First Graph" { ' . PHP_EOL . 'label="PigeonPost" ' . PHP_EOL . '} ' )
367
+ $ this -> normalizeLineEndings ( ( string ) $ graph ) ,
368
+ $ this -> normalizeLineEndings ( ( 'digraph "My First Graph" { ' . PHP_EOL . 'label="PigeonPost" ' . PHP_EOL . '} ' ) )
369
369
);
370
370
371
371
$ graph ->setStrict (true );
372
372
$ this ->assertSame (
373
- ( string ) $ graph ,
374
- ( 'strict digraph "My First Graph" { ' . PHP_EOL . 'label="PigeonPost" ' . PHP_EOL . '} ' )
373
+ $ this -> normalizeLineEndings ( ( string ) $ graph ) ,
374
+ $ this -> normalizeLineEndings ( ( 'strict digraph "My First Graph" { ' . PHP_EOL . 'label="PigeonPost" ' . PHP_EOL . '} ' ) )
375
375
);
376
376
}
377
377
378
+ /**
379
+ * Help avoid issue of "#Warning: Strings contain different line endings!" on Windows.
380
+ */
381
+ private function normalizeLineEndings ($ string )
382
+ {
383
+ return preg_replace ('~\R~u ' , "\r\n" , $ string );
384
+ }
385
+
378
386
}
You can’t perform that action at this time.
0 commit comments