1
1
<?php
2
2
3
- namespace Knp \Snappy ;
3
+ namespace Tests \ Knp \Snappy ;
4
4
5
+ use Knp \Snappy \AbstractGenerator ;
5
6
use PHPUnit \Framework \TestCase ;
6
7
use Psr \Log \LoggerInterface ;
7
8
8
9
class AbstractGeneratorTest extends TestCase
9
10
{
10
11
public function testAddOption ()
11
12
{
12
- $ media = $ this ->getMockForAbstractClass (' Knp\Snappy\ AbstractGenerator' , [], '' , false );
13
+ $ media = $ this ->getMockForAbstractClass (AbstractGenerator::class , [], '' , false );
13
14
14
15
$ this ->assertEquals ([], $ media ->getOptions ());
15
16
@@ -36,13 +37,13 @@ public function testAddOption()
36
37
$ r ->invokeArgs ($ media , ['baz ' , 'bat ' ]);
37
38
$ this ->fail ($ message );
38
39
} catch (\InvalidArgumentException $ e ) {
39
- $ this ->anything ($ message );
40
+ $ this ->anything ();
40
41
}
41
42
}
42
43
43
44
public function testAddOptions ()
44
45
{
45
- $ media = $ this ->getMockForAbstractClass (' Knp\Snappy\ AbstractGenerator' , [], '' , false );
46
+ $ media = $ this ->getMockForAbstractClass (AbstractGenerator::class , [], '' , false );
46
47
47
48
$ this ->assertEquals ([], $ media ->getOptions ());
48
49
@@ -78,7 +79,7 @@ public function testAddOptions()
78
79
$ r ->invokeArgs ($ media , [['bak ' => 'bam ' , 'bah ' => 'bap ' , 'baz ' => 'bat ' ]]);
79
80
$ this ->fail ($ message );
80
81
} catch (\InvalidArgumentException $ e ) {
81
- $ this ->anything ($ message );
82
+ $ this ->anything ();
82
83
}
83
84
}
84
85
@@ -117,7 +118,7 @@ public function testSetOption()
117
118
$ media ->setOption ('bad ' , 'def ' );
118
119
$ this ->fail ($ message );
119
120
} catch (\InvalidArgumentException $ e ) {
120
- $ this ->anything ($ message );
121
+ $ this ->anything ();
121
122
}
122
123
}
123
124
@@ -157,7 +158,7 @@ public function testSetOptions()
157
158
$ media ->setOptions (['foo ' => 'abc ' , 'baz ' => 'def ' , 'bad ' => 'ghi ' ]);
158
159
$ this ->fail ($ message );
159
160
} catch (\InvalidArgumentException $ e ) {
160
- $ this ->anything ($ message );
161
+ $ this ->anything ();
161
162
}
162
163
}
163
164
@@ -493,7 +494,7 @@ public function testGetOutputFromHtmlWithHtmlArray()
493
494
494
495
public function testMergeOptions ()
495
496
{
496
- $ media = $ this ->getMockForAbstractClass (' Knp\Snappy\ AbstractGenerator' , [], '' , false );
497
+ $ media = $ this ->getMockForAbstractClass (AbstractGenerator::class , [], '' , false );
497
498
498
499
$ originalOptions = ['foo ' => 'bar ' , 'baz ' => 'bat ' ];
499
500
@@ -538,7 +539,7 @@ public function testMergeOptions()
538
539
$ r ->invokeArgs ($ media , [['foo ' => 'ban ' , 'bad ' => 'bah ' ]]);
539
540
$ this ->fail ($ message );
540
541
} catch (\InvalidArgumentException $ e ) {
541
- $ this ->anything ($ message );
542
+ $ this ->anything ();
542
543
}
543
544
}
544
545
@@ -547,7 +548,7 @@ public function testMergeOptions()
547
548
*/
548
549
public function testBuildCommand ($ binary , $ url , $ path , $ options , $ expected )
549
550
{
550
- $ media = $ this ->getMockForAbstractClass (' Knp\Snappy\ AbstractGenerator' , [], '' , false );
551
+ $ media = $ this ->getMockForAbstractClass (AbstractGenerator::class , [], '' , false );
551
552
552
553
$ r = new \ReflectionMethod ($ media , 'buildCommand ' );
553
554
$ r ->setAccessible (true );
@@ -679,7 +680,7 @@ public function testCheckOutput()
679
680
680
681
try {
681
682
$ r ->invokeArgs ($ media , ['the_output_file ' , 'the command ' ]);
682
- $ this ->anything ($ message );
683
+ $ this ->anything ();
683
684
} catch (\RuntimeException $ e ) {
684
685
$ this ->fail ($ message );
685
686
}
@@ -712,7 +713,7 @@ public function testCheckOutputWhenTheFileDoesNotExist()
712
713
$ r ->invokeArgs ($ media , ['the_output_file ' , 'the command ' ]);
713
714
$ this ->fail ($ message );
714
715
} catch (\RuntimeException $ e ) {
715
- $ this ->anything ($ message );
716
+ $ this ->anything ();
716
717
}
717
718
}
718
719
@@ -750,7 +751,7 @@ public function testCheckOutputWhenTheFileIsEmpty()
750
751
$ r ->invokeArgs ($ media , ['the_output_file ' , 'the command ' ]);
751
752
$ this ->fail ($ message );
752
753
} catch (\RuntimeException $ e ) {
753
- $ this ->anything ($ message );
754
+ $ this ->anything ();
754
755
}
755
756
}
756
757
@@ -767,14 +768,14 @@ public function testCheckProcessStatus()
767
768
768
769
try {
769
770
$ r ->invokeArgs ($ media , [0 , '' , '' , 'the command ' ]);
770
- $ this ->anything (' 0 status means success ' );
771
+ $ this ->anything ();
771
772
} catch (\RuntimeException $ e ) {
772
773
$ this ->fail ('0 status means success ' );
773
774
}
774
775
775
776
try {
776
777
$ r ->invokeArgs ($ media , [1 , '' , '' , 'the command ' ]);
777
- $ this ->anything (' 1 status means failure, but no stderr content ' );
778
+ $ this ->anything ();
778
779
} catch (\RuntimeException $ e ) {
779
780
$ this ->fail ('1 status means failure, but no stderr content ' );
780
781
}
@@ -792,7 +793,7 @@ public function testCheckProcessStatus()
792
793
*/
793
794
public function testIsAssociativeArray ($ array , $ isAssociativeArray )
794
795
{
795
- $ generator = $ this ->getMockForAbstractClass (' Knp\Snappy\ AbstractGenerator' , [], '' , false );
796
+ $ generator = $ this ->getMockForAbstractClass (AbstractGenerator::class , [], '' , false );
796
797
797
798
$ r = new \ReflectionMethod ($ generator , 'isAssociativeArray ' );
798
799
$ r ->setAccessible (true );
0 commit comments