mirror of
https://github.com/silverstripe/silverstripe-externallinks.git
synced 2024-10-22 15:05:44 +00:00
Merge pull request #8 from silverstripe-labs/pulls/avoid-hamcrest-globals
Include Hamcrest without clashing with PHPUnit globals
This commit is contained in:
commit
b219ebb52e
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (class_exists('Phockito')) Phockito::include_hamcrest();
|
||||
|
||||
class ExternalLinksTest extends SapphireTest {
|
||||
|
||||
protected static $fixture_file = 'ExternalLinksTest.yml';
|
||||
@ -10,6 +8,14 @@ class ExternalLinksTest extends SapphireTest {
|
||||
'ExternalLinksTest_Page'
|
||||
);
|
||||
|
||||
public function setUpOnce() {
|
||||
if (class_exists('Phockito')) {
|
||||
Phockito::include_hamcrest(false);
|
||||
}
|
||||
|
||||
parent::setUpOnce();
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
@ -60,7 +66,7 @@ class ExternalLinksTest extends SapphireTest {
|
||||
->return(null);
|
||||
|
||||
Phockito::when($checker)
|
||||
->checkLink(anything()) // anything else is 404
|
||||
->checkLink(Hamcrest_Matchers::anything()) // anything else is 404
|
||||
->return(404);
|
||||
|
||||
Injector::inst()->registerService($checker, 'LinkChecker');
|
||||
|
Loading…
x
Reference in New Issue
Block a user