@@ -17,9 +17,12 @@ protected function getConfiguration()
1717 */
1818 public function it_can_assert_that_a_configuration_is_invalid ()
1919 {
20- $ this ->assertConfigurationIsInvalid (array (
21- array () // no configuration values
22- ), 'required_value ' );
20+ $ this ->assertConfigurationIsInvalid (
21+ array (
22+ array () // no configuration values
23+ ),
24+ 'required_value '
25+ );
2326 }
2427
2528 /**
@@ -29,9 +32,11 @@ public function it_fails_when_a_configuration_is_valid_when_it_should_have_been_
2932 {
3033 $ this ->setExpectedException ('\PHPUnit_Framework_ExpectationFailedException ' , 'invalid ' );
3134
32- $ this ->assertConfigurationIsInvalid (array (
33- array ('required_value ' => 'some value ' )
34- ));
35+ $ this ->assertConfigurationIsInvalid (
36+ array (
37+ array ('required_value ' => 'some value ' )
38+ )
39+ );
3540 }
3641
3742 /**
@@ -41,12 +46,15 @@ public function it_can_assert_that_a_processed_configuration_matches_the_expecte
4146 {
4247 $ value = 'some value ' ;
4348
44- $ this ->assertProcessedConfigurationEquals (array (
45- array (),
46- array ('required_value ' => $ value )
47- ), array (
48- 'required_value ' => $ value
49- ));
49+ $ this ->assertProcessedConfigurationEquals (
50+ array (
51+ array (),
52+ array ('required_value ' => $ value )
53+ ),
54+ array (
55+ 'required_value ' => $ value
56+ )
57+ );
5058 }
5159
5260 /**
@@ -57,10 +65,42 @@ public function it_fails_when_a_processed_configuration_does_not_match_the_expec
5765 $ value = 'some value ' ;
5866
5967 $ this ->setExpectedException ('\PHPUnit_Framework_ExpectationFailedException ' , 'equal ' );
60- $ this ->assertProcessedConfigurationEquals (array (
68+ $ this ->assertProcessedConfigurationEquals (
69+ array (
70+ array ('required_value ' => $ value )
71+ ),
72+ array (
73+ 'invalid_key ' => 'invalid_value '
74+ )
75+ );
76+ }
77+
78+ /**
79+ * @test
80+ */
81+ public function it_throws_a_comparison_failed_exception_with_the_values_in_the_right_order ()
82+ {
83+ $ value = 'some value ' ;
84+
85+ //$this->setExpectedException('\PHPUnit_Framework_ExpectationFailedException', 'equal');
86+ $ configurationValues = array (
6187 array ('required_value ' => $ value )
62- ), array (
63- 'invalid_key ' => 'invalid_value '
64- ));
88+ );
89+
90+ $ expectedProcessedConfigurationValues = array (
91+ 'invalid_key ' => 'invalid_value '
92+ );
93+
94+ try {
95+ $ this ->assertProcessedConfigurationEquals (
96+ $ configurationValues ,
97+ $ expectedProcessedConfigurationValues
98+ );
99+ } catch (\PHPUnit_Framework_ExpectationFailedException $ exception ) {
100+ $ this ->assertSame (
101+ $ expectedProcessedConfigurationValues ,
102+ $ exception ->getComparisonFailure ()->getExpected ()
103+ );
104+ }
65105 }
66106}
0 commit comments