@@ -40,36 +40,75 @@ protected function assertConfigurationIsInvalid(array $configurationValues, $exp
40
40
);
41
41
}
42
42
43
+ /**
44
+ * Assert that the given configuration values are invalid.
45
+ *
46
+ * Optionally provide (part of) the exception message that you expect to receive.
47
+ *
48
+ * When running PHPUnit >=4.3.0, you need to set useRegExp to true if you'd like
49
+ * to match the exception message using a regular expression.
50
+ *
51
+ * @param array $configurationValues
52
+ * @param string $breadcrumbPath The path that should be validated, e.g. "doctrine.orm"
53
+ * @param string|null $expectedMessage
54
+ * @param bool $useRegExp
55
+ */
56
+ protected function assertPartialConfigurationIsInvalid (
57
+ array $ configurationValues ,
58
+ $ breadcrumbPath ,
59
+ $ expectedMessage = null ,
60
+ $ useRegExp = false
61
+ ) {
62
+ \PHPUnit_Framework_TestCase::assertThat (
63
+ $ configurationValues ,
64
+ new ConfigurationValuesAreInvalidConstraint (
65
+ $ this ->getConfiguration (),
66
+ $ expectedMessage ,
67
+ $ useRegExp ,
68
+ $ breadcrumbPath
69
+ )
70
+ );
71
+ }
72
+
43
73
/**
44
74
* Assert that the given configuration values are valid.
45
75
*
76
+ * Optionally provide the part of the configuration that you want to test, e.g. "doctrine.orm"
77
+ *
46
78
* @param array $configurationValues
79
+ * @param string|null $breadcrumbPath
47
80
*/
48
- protected function assertConfigurationIsValid (array $ configurationValues )
81
+ protected function assertConfigurationIsValid (array $ configurationValues, $ breadcrumbPath = null )
49
82
{
50
83
\PHPUnit_Framework_TestCase::assertThat (
51
84
$ configurationValues ,
52
85
new ConfigurationValuesAreValidConstraint (
53
- $ this ->getConfiguration ()
86
+ $ this ->getConfiguration (),
87
+ $ breadcrumbPath
54
88
)
55
89
);
56
90
}
57
91
58
92
/**
59
- * Assert that the given configuration values, when processed, will equal to the given array
93
+ * Assert that the given configuration values, when processed, will equal to the given array.
94
+ *
95
+ * Optionally provide the part of the configuration that you want to test, e.g. "doctrine.orm"
60
96
*
61
97
* @param array $configurationValues
62
98
* @param array $expectedProcessedConfiguration
99
+ * @param string|null $breadcrumbPath
63
100
*/
64
101
protected function assertProcessedConfigurationEquals (
65
102
array $ configurationValues ,
66
- array $ expectedProcessedConfiguration
103
+ array $ expectedProcessedConfiguration ,
104
+ $ breadcrumbPath = null
67
105
) {
68
106
\PHPUnit_Framework_TestCase::assertThat (
69
107
$ expectedProcessedConfiguration ,
70
108
new ProcessedConfigurationEqualsConstraint (
71
109
$ this ->getConfiguration (),
72
- $ configurationValues
110
+ $ configurationValues ,
111
+ $ breadcrumbPath
73
112
)
74
113
);
75
114
}
0 commit comments