Merge pull request #194 from creative-commoners/pulls/2/sapphire-test-nine

API phpunit 9 support
This commit is contained in:
Maxime Rainville 2021-11-01 22:33:09 +13:00 committed by GitHub
commit 3f595cf09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 15 deletions

View File

@ -19,11 +19,12 @@
"issues": "http://github.com/silverstripe/silverstripe-tagfield/issues"
},
"require": {
"silverstripe/framework": "^4.3",
"php": "^7.3 || ^8.0",
"silverstripe/framework": "^4.10",
"silverstripe/versioned": "^1.3"
},
"require-dev": {
"sminnee/phpunit": "^5.7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {

View File

@ -1,7 +1,9 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
<testsuites>
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>

View File

@ -2,7 +2,6 @@
namespace SilverStripe\TagField\Tests;
use PHPUnit_Framework_TestCase;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
@ -10,9 +9,6 @@ use SilverStripe\Forms\Form;
use SilverStripe\TagField\StringTagField;
use SilverStripe\TagField\Tests\Stub\StringTagFieldTestBlogPost;
/**
* @mixin PHPUnit_Framework_TestCase
*/
class StringTagFieldTest extends SapphireTest
{
/**
@ -133,7 +129,7 @@ class StringTagFieldTest extends SapphireTest
$schema = $field->getSchemaDataDefaults();
$this->assertTrue($schema['lazyLoad']);
$this->assertTrue($schema['creatable']);
$this->assertContains('suggest', $schema['optionUrl']);
$this->assertStringContainsString('suggest', $schema['optionUrl']);
}
public function testSchemaIsAddedToAttributes()

View File

@ -2,7 +2,6 @@
namespace SilverStripe\TagField\Tests;
use PHPUnit_Framework_TestCase;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
@ -15,9 +14,6 @@ use SilverStripe\TagField\Tests\Stub\TagFieldTestBlogPost;
use SilverStripe\TagField\Tests\Stub\TagFieldTestBlogTag;
use SilverStripe\TagField\Tests\Stub\TagFieldTestController;
/**
* @mixin PHPUnit_Framework_TestCase
*/
class TagFieldTest extends SapphireTest
{
/**
@ -436,7 +432,7 @@ class TagFieldTest extends SapphireTest
$schema = $field->getSchemaDataDefaults();
$this->assertTrue($schema['lazyLoad']);
$this->assertTrue($schema['creatable']);
$this->assertContains('suggest', $schema['optionUrl']);
$this->assertStringContainsString('suggest', $schema['optionUrl']);
}
public function testSchemaIsAddedToAttributes()