@@ -42,6 +42,36 @@ public function testBinaryWithPhp(): void
42
42
self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-php/missing-identifier.php ' , $ fakeRoot . '/baselines/missing-identifier.php ' );
43
43
}
44
44
45
+ public function testBinaryWithNeonNoErrorCount (): void
46
+ {
47
+ $ fakeRoot = $ this ->prepareSampleFolder ();
48
+ $ squashed = $ this ->getSampleErrors ();
49
+
50
+ file_put_contents ($ fakeRoot . '/baselines/loader.neon ' , Neon::encode ($ squashed ));
51
+
52
+ $ this ->runCommand ('php bin/split-phpstan-baseline ' . $ fakeRoot . '/baselines/loader.neon --no-error-count ' , __DIR__ . '/.. ' , 0 );
53
+
54
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-neon-no-error-count/loader.neon ' , $ fakeRoot . '/baselines/loader.neon ' );
55
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-neon-no-error-count/sample.identifier.neon ' , $ fakeRoot . '/baselines/sample.identifier.neon ' );
56
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-neon-no-error-count/another.identifier.neon ' , $ fakeRoot . '/baselines/another.identifier.neon ' );
57
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-neon-no-error-count/missing-identifier.neon ' , $ fakeRoot . '/baselines/missing-identifier.neon ' );
58
+ }
59
+
60
+ public function testBinaryWithPhpNoErrorCount (): void
61
+ {
62
+ $ fakeRoot = $ this ->prepareSampleFolder ();
63
+ $ squashed = $ this ->getSampleErrors ();
64
+
65
+ file_put_contents ($ fakeRoot . '/baselines/loader.php ' , '<?php return ' . var_export ($ squashed , true ) . '; ' );
66
+
67
+ $ this ->runCommand ('php bin/split-phpstan-baseline ' . $ fakeRoot . '/baselines/loader.php --no-error-count ' , __DIR__ . '/.. ' , 0 );
68
+
69
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-php-no-error-count/loader.php ' , $ fakeRoot . '/baselines/loader.php ' );
70
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-php-no-error-count/sample.identifier.php ' , $ fakeRoot . '/baselines/sample.identifier.php ' );
71
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-php-no-error-count/another.identifier.php ' , $ fakeRoot . '/baselines/another.identifier.php ' );
72
+ self ::assertFileEquals (__DIR__ . '/Rule/data/baselines-php-no-error-count/missing-identifier.php ' , $ fakeRoot . '/baselines/missing-identifier.php ' );
73
+ }
74
+
45
75
public function testSplitter (): void
46
76
{
47
77
$ folder = $ this ->prepareSampleFolder ();
@@ -50,7 +80,7 @@ public function testSplitter(): void
50
80
$ loaderPath = $ folder . '/baselines/loader.neon ' ;
51
81
file_put_contents ($ loaderPath , Neon::encode ($ squashed ));
52
82
53
- $ splitter = new BaselineSplitter ("\t" );
83
+ $ splitter = new BaselineSplitter ("\t" , true );
54
84
$ written = $ splitter ->split ($ loaderPath );
55
85
56
86
self ::assertSame ([
0 commit comments