@@ -32,11 +32,12 @@ public static function assertIsReadable( $filename, $message = '' ) {
3232 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
3333 }
3434
35- if ( $ message === '' ) {
36- $ message = \sprintf ( 'Failed asserting that "%s" is readable ' , $ filename );
35+ $ msg = \sprintf ( 'Failed asserting that "%s" is readable ' , $ filename );
36+ if ( $ message !== '' ) {
37+ $ msg = $ message . \PHP_EOL . $ msg ;
3738 }
3839
39- static ::assertTrue ( \is_readable ( $ filename ), $ message );
40+ static ::assertTrue ( \is_readable ( $ filename ), $ msg );
4041 }
4142
4243 /**
@@ -54,11 +55,12 @@ public static function assertNotIsReadable( $filename, $message = '' ) {
5455 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
5556 }
5657
57- if ( $ message === '' ) {
58- $ message = \sprintf ( 'Failed asserting that "%s" is not readable ' , $ filename );
58+ $ msg = \sprintf ( 'Failed asserting that "%s" is not readable ' , $ filename );
59+ if ( $ message !== '' ) {
60+ $ msg = $ message . \PHP_EOL . $ msg ;
5961 }
6062
61- static ::assertFalse ( \is_readable ( $ filename ), $ message );
63+ static ::assertFalse ( \is_readable ( $ filename ), $ msg );
6264 }
6365
6466 /**
@@ -76,11 +78,12 @@ public static function assertIsWritable( $filename, $message = '' ) {
7678 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
7779 }
7880
79- if ( $ message === '' ) {
80- $ message = \sprintf ( 'Failed asserting that "%s" is writable ' , $ filename );
81+ $ msg = \sprintf ( 'Failed asserting that "%s" is writable ' , $ filename );
82+ if ( $ message !== '' ) {
83+ $ msg = $ message . \PHP_EOL . $ msg ;
8184 }
8285
83- static ::assertTrue ( \is_writable ( $ filename ), $ message );
86+ static ::assertTrue ( \is_writable ( $ filename ), $ msg );
8487 }
8588
8689 /**
@@ -98,11 +101,12 @@ public static function assertNotIsWritable( $filename, $message = '' ) {
98101 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
99102 }
100103
101- if ( $ message === '' ) {
102- $ message = \sprintf ( 'Failed asserting that "%s" is not writable ' , $ filename );
104+ $ msg = \sprintf ( 'Failed asserting that "%s" is not writable ' , $ filename );
105+ if ( $ message !== '' ) {
106+ $ msg = $ message . \PHP_EOL . $ msg ;
103107 }
104108
105- static ::assertFalse ( \is_writable ( $ filename ), $ message );
109+ static ::assertFalse ( \is_writable ( $ filename ), $ msg );
106110 }
107111
108112 /**
@@ -120,11 +124,12 @@ public static function assertDirectoryExists( $directory, $message = '' ) {
120124 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
121125 }
122126
123- if ( $ message === '' ) {
124- $ message = \sprintf ( 'Failed asserting that directory "%s" exists ' , $ directory );
127+ $ msg = \sprintf ( 'Failed asserting that directory "%s" exists ' , $ directory );
128+ if ( $ message !== '' ) {
129+ $ msg = $ message . \PHP_EOL . $ msg ;
125130 }
126131
127- static ::assertTrue ( \is_dir ( $ directory ), $ message );
132+ static ::assertTrue ( \is_dir ( $ directory ), $ msg );
128133 }
129134
130135 /**
@@ -142,11 +147,12 @@ public static function assertDirectoryNotExists( $directory, $message = '' ) {
142147 throw PHPUnit_Util_InvalidArgumentHelper::factory ( 1 , 'string ' );
143148 }
144149
145- if ( $ message === '' ) {
146- $ message = \sprintf ( 'Failed asserting that directory "%s" does not exist ' , $ directory );
150+ $ msg = \sprintf ( 'Failed asserting that directory "%s" does not exist ' , $ directory );
151+ if ( $ message !== '' ) {
152+ $ msg = $ message . \PHP_EOL . $ msg ;
147153 }
148154
149- static ::assertFalse ( \is_dir ( $ directory ), $ message );
155+ static ::assertFalse ( \is_dir ( $ directory ), $ msg );
150156 }
151157
152158 /**
0 commit comments