File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ matrix:
32
32
- php : 5.6
33
33
env : SYMFONY_VERSION=3.0.*
34
34
35
- before_script :
36
- - composer self-update
35
+ before_install :
36
+ - composer self-update || true
37
+
38
+ install :
37
39
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
38
40
- composer update --prefer-source $COMPOSER_FLAGS
39
41
Original file line number Diff line number Diff line change 13
13
namespace Symfony \Cmf \Component \Testing \Functional ;
14
14
15
15
use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
16
+ use Symfony \Component \HttpFoundation \Response ;
16
17
use Symfony \Component \DependencyInjection \Container ;
17
18
18
19
/**
@@ -121,4 +122,21 @@ protected static function createKernel(array $options = array())
121
122
122
123
return parent ::createKernel ($ options );
123
124
}
125
+
126
+ protected function assertResponseSuccess (Response $ response )
127
+ {
128
+ libxml_use_internal_errors (true );
129
+
130
+ $ dom = new \DomDocument ();
131
+ $ dom ->loadHTML ($ response ->getContent ());
132
+
133
+ $ xpath = new \DOMXpath ($ dom );
134
+ $ result = $ xpath ->query ('//div[contains(@class,"text-exception")]/h1 ' );
135
+ $ exception = null ;
136
+ if ($ result ->length ) {
137
+ $ exception = $ result ->item (0 )->nodeValue ;
138
+ }
139
+
140
+ $ this ->assertEquals (200 , $ response ->getStatusCode (), $ exception ? 'Exception: " ' .$ exception .'" ' : null );
141
+ }
124
142
}
You can’t perform that action at this time.
0 commit comments