@@ -43,36 +43,75 @@ protected function assertConfigurationIsInvalid(array $configurationValues, $exp
4343 );
4444 }
4545
46+ /**
47+ * Assert that the given configuration values are invalid.
48+ *
49+ * Optionally provide (part of) the exception message that you expect to receive.
50+ *
51+ * When running PHPUnit >=4.3.0, you need to set useRegExp to true if you'd like
52+ * to match the exception message using a regular expression.
53+ *
54+ * @param array $configurationValues
55+ * @param string $breadcrumbPath The path that should be validated, e.g. "doctrine.orm"
56+ * @param string|null $expectedMessage
57+ * @param bool $useRegExp
58+ */
59+ protected function assertPartialConfigurationIsInvalid (
60+ array $ configurationValues ,
61+ $ breadcrumbPath ,
62+ $ expectedMessage = null ,
63+ $ useRegExp = false
64+ ) {
65+ self ::assertThat (
66+ $ configurationValues ,
67+ new ConfigurationValuesAreInvalidConstraint (
68+ $ this ->getConfiguration (),
69+ $ expectedMessage ,
70+ $ useRegExp ,
71+ $ breadcrumbPath
72+ )
73+ );
74+ }
75+
4676 /**
4777 * Assert that the given configuration values are valid.
4878 *
79+ * Optionally provide the part of the configuration that you want to test, e.g. "doctrine.orm"
80+ *
4981 * @param array $configurationValues
82+ * @param string|null $breadcrumbPath
5083 */
51- protected function assertConfigurationIsValid (array $ configurationValues )
84+ protected function assertConfigurationIsValid (array $ configurationValues, $ breadcrumbPath = null )
5285 {
5386 self ::assertThat (
5487 $ configurationValues ,
5588 new ConfigurationValuesAreValidConstraint (
56- $ this ->getConfiguration ()
89+ $ this ->getConfiguration (),
90+ $ breadcrumbPath
5791 )
5892 );
5993 }
6094
6195 /**
62- * Assert that the given configuration values, when processed, will equal to the given array
96+ * Assert that the given configuration values, when processed, will equal to the given array.
97+ *
98+ * Optionally provide the part of the configuration that you want to test, e.g. "doctrine.orm"
6399 *
64100 * @param array $configurationValues
65101 * @param array $expectedProcessedConfiguration
102+ * @param string|null $breadcrumbPath
66103 */
67104 protected function assertProcessedConfigurationEquals (
68105 array $ configurationValues ,
69- array $ expectedProcessedConfiguration
106+ array $ expectedProcessedConfiguration ,
107+ $ breadcrumbPath = null
70108 ) {
71109 self ::assertThat (
72110 $ expectedProcessedConfiguration ,
73111 new ProcessedConfigurationEqualsConstraint (
74112 $ this ->getConfiguration (),
75- $ configurationValues
113+ $ configurationValues ,
114+ $ breadcrumbPath
76115 )
77116 );
78117 }
0 commit comments