Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/phpunit-bridge/DnsMock.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
161 return $records; | 161 return $records; |
162 } | 162 } |
163 | 163 |
164 public static function register($class) | 164 public static function register($class) |
165 { | 165 { |
166 $self = get_called_class(); | 166 $self = \get_called_class(); |
167 | 167 |
168 $mockedNs = array(substr($class, 0, strrpos($class, '\\'))); | 168 $mockedNs = array(substr($class, 0, strrpos($class, '\\'))); |
169 if (0 < strpos($class, '\\Tests\\')) { | 169 if (0 < strpos($class, '\\Tests\\')) { |
170 $ns = str_replace('\\Tests\\', '\\', $class); | 170 $ns = str_replace('\\Tests\\', '\\', $class); |
171 $mockedNs[] = substr($ns, 0, strrpos($ns, '\\')); | 171 $mockedNs[] = substr($ns, 0, strrpos($ns, '\\')); |
172 } elseif (0 === strpos($class, 'Tests\\')) { | 172 } elseif (0 === strpos($class, 'Tests\\')) { |
173 $mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6); | 173 $mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6); |
174 } | 174 } |
175 foreach ($mockedNs as $ns) { | 175 foreach ($mockedNs as $ns) { |
176 if (function_exists($ns.'\checkdnsrr')) { | 176 if (\function_exists($ns.'\checkdnsrr')) { |
177 continue; | 177 continue; |
178 } | 178 } |
179 eval(<<<EOPHP | 179 eval(<<<EOPHP |
180 namespace $ns; | 180 namespace $ns; |
181 | 181 |