API Update deprecations for SapphireTest and FunctionalTest

This commit is contained in:
Steve Boyd 2022-10-12 16:51:47 +13:00
parent 2991901660
commit e6aa183eb4
2 changed files with 34 additions and 35 deletions

View File

@ -430,7 +430,7 @@ if (class_exists(IsEqualCanonicalizing::class)) {
*/
public function useDraftSite($enabled = true)
{
Deprecation::notice('5.0', 'Use ?stage=Stage querystring arguments instead of useDraftSite');
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your request\'s querystring instead');
if ($enabled) {
$this->session()->set('readingMode', 'Stage.Stage');
$this->session()->set('unsecuredDraftSite', true);
@ -454,7 +454,7 @@ if (class_exists(IsEqualCanonicalizing::class)) {
*/
public static function get_use_draft_site()
{
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your querystring arguments instead');
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your request\'s querystring instead');
return static::$use_draft_site;
}
}
@ -875,7 +875,7 @@ class FunctionalTest extends SapphireTest implements TestOnly
*/
public function useDraftSite($enabled = true)
{
Deprecation::notice('5.0', 'Use ?stage=Stage querystring arguments instead of useDraftSite');
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your request\'s querystring instead');
if ($enabled) {
$this->session()->set('readingMode', 'Stage.Stage');
$this->session()->set('unsecuredDraftSite', true);
@ -899,7 +899,7 @@ class FunctionalTest extends SapphireTest implements TestOnly
*/
public static function get_use_draft_site()
{
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your querystring arguments instead');
Deprecation::notice('4.2.0', 'Use ?stage=Stage in your request\'s querystring instead');
return static::$use_draft_site;
}
}

View File

@ -98,7 +98,7 @@ if (class_exists(IsEqualCanonicalizing::class)) {
protected static $fixture_file = null;
/**
* @deprecated 4.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
* @var FixtureFactory
*/
protected $fixtureFactory;
@ -472,11 +472,11 @@ if (class_exists(IsEqualCanonicalizing::class)) {
/**
* @return FixtureFactory|false
* @deprecated 4.0.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
*/
public function getFixtureFactory()
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
/** @var FixtureTestState $state */
$state = static::$state->getStateByName('fixtures');
return $state->getFixtureFactory(static::class);
@ -486,11 +486,11 @@ if (class_exists(IsEqualCanonicalizing::class)) {
* Sets a new fixture factory
* @param FixtureFactory $factory
* @return $this
* @deprecated 4.0.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
*/
public function setFixtureFactory(FixtureFactory $factory)
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
/** @var FixtureTestState $state */
$state = static::$state->getStateByName('fixtures');
$state->setFixtureFactory($factory, static::class);
@ -566,12 +566,11 @@ if (class_exists(IsEqualCanonicalizing::class)) {
* Once loaded, you can use idFromFixture() and objFromFixture() to get items from the fixture.
* Doesn't clear existing fixtures.
* @param string $fixtureFile The location of the .yml fixture file, relative to the site base dir
* @deprecated 4.0.0
*
* @deprecated 4.0.1 Use FixtureTestState instead
*/
public function loadFixture($fixtureFile)
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
$fixture = Injector::inst()->create(YamlFixture::class, $fixtureFile);
$fixture->writeInto($this->getFixtureFactory());
}
@ -762,12 +761,12 @@ if (class_exists(IsEqualCanonicalizing::class)) {
/**
* @param $matches
* @param $dataObjectSet
* @deprecated 4.0.0 Use assertListContains() instead
* @deprecated 4.0.1 Use assertListContains() instead
*
*/
public function assertDOSContains($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListContains() instead');
Deprecation::notice('4.0.1', 'Use assertListContains() instead');
static::assertListContains($matches, $dataObjectSet);
}
@ -816,12 +815,12 @@ if (class_exists(IsEqualCanonicalizing::class)) {
/**
* @param $matches
* @param $dataObjectSet
* @deprecated 4.0.0 Use assertListNotContains() instead
* @deprecated 4.0.1 Use assertListNotContains() instead
*
*/
public static function assertNotDOSContains($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListNotContains() instead');
Deprecation::notice('4.0.1', 'Use assertListNotContains() instead');
static::assertListNotContains($matches, $dataObjectSet);
}
@ -864,12 +863,12 @@ if (class_exists(IsEqualCanonicalizing::class)) {
/**
* @param $matches
* @param SS_List $dataObjectSet
* @deprecated 4.0.0 Use assertListEquals() instead
* @deprecated 4.0.1 Use assertListEquals() instead
*
*/
public function assertDOSEquals($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListEquals() instead');
Deprecation::notice('4.0.1', 'Use assertListEquals() instead');
static::assertListEquals($matches, $dataObjectSet);
}
@ -908,12 +907,12 @@ if (class_exists(IsEqualCanonicalizing::class)) {
/**
* @param $match
* @param SS_List $dataObjectSet
* @deprecated 4.0.0 Use assertListAllMatch() instead
* @deprecated 4.0.1 Use assertListAllMatch() instead
*
*/
public function assertDOSAllMatch($match, SS_List $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListAllMatch() instead');
Deprecation::notice('4.0.1', 'Use assertListAllMatch() instead');
static::assertListAllMatch($match, $dataObjectSet);
}
@ -1416,7 +1415,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
protected static $fixture_file = null;
/**
* @deprecated 4.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
* @var FixtureFactory
*/
protected $fixtureFactory;
@ -1793,11 +1792,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
/**
* @return FixtureFactory|false
* @deprecated 4.0.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
*/
public function getFixtureFactory()
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
/** @var FixtureTestState $state */
$state = static::$state->getStateByName('fixtures');
return $state->getFixtureFactory(static::class);
@ -1807,11 +1806,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
* Sets a new fixture factory
* @param FixtureFactory $factory
* @return $this
* @deprecated 4.0.0 Use FixtureTestState instead
* @deprecated 4.0.1 Use FixtureTestState instead
*/
public function setFixtureFactory(FixtureFactory $factory)
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
/** @var FixtureTestState $state */
$state = static::$state->getStateByName('fixtures');
$state->setFixtureFactory($factory, static::class);
@ -1887,12 +1886,12 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
* Once loaded, you can use idFromFixture() and objFromFixture() to get items from the fixture.
* Doesn't clear existing fixtures.
* @param string $fixtureFile The location of the .yml fixture file, relative to the site base dir
* @deprecated 4.0.0
* @deprecated 4.0.1 Use FixtureTestState instead
*
*/
public function loadFixture($fixtureFile)
{
Deprecation::notice('5.0', __FUNCTION__ . ' is deprecated, use ' . FixtureTestState::class . ' instead');
Deprecation::notice('4.0.1', 'Use FixtureTestState instead');
$fixture = Injector::inst()->create(YamlFixture::class, $fixtureFile);
$fixture->writeInto($this->getFixtureFactory());
}
@ -2110,12 +2109,12 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
/**
* @param $matches
* @param $dataObjectSet
* @deprecated 4.0.0 Use assertListContains() instead
* @deprecated 4.0.1 Use assertListContains() instead
*
*/
public function assertDOSContains($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListContains() instead');
Deprecation::notice('4.0.1', 'Use assertListContains() instead');
return static::assertListContains($matches, $dataObjectSet);
}
@ -2164,12 +2163,12 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
/**
* @param $matches
* @param $dataObjectSet
* @deprecated 4.0.0 Use assertListNotContains() instead
* @deprecated 4.0.1 Use assertListNotContains() instead
*
*/
public static function assertNotDOSContains($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListNotContains() instead');
Deprecation::notice('4.0.1', 'Use assertListNotContains() instead');
return static::assertListNotContains($matches, $dataObjectSet);
}
@ -2212,12 +2211,12 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
/**
* @param $matches
* @param SS_List $dataObjectSet
* @deprecated 4.0.0 Use assertListEquals() instead
* @deprecated 4.0.1 Use assertListEquals() instead
*
*/
public function assertDOSEquals($matches, $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListEquals() instead');
Deprecation::notice('4.0.1', 'Use assertListEquals() instead');
return static::assertListEquals($matches, $dataObjectSet);
}
@ -2255,12 +2254,12 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
/**
* @param $match
* @param SS_List $dataObjectSet
* @deprecated 4.0.0 Use assertListAllMatch() instead
* @deprecated 4.0.1 Use assertListAllMatch() instead
*
*/
public function assertDOSAllMatch($match, SS_List $dataObjectSet)
{
Deprecation::notice('5.0', 'Use assertListAllMatch() instead');
Deprecation::notice('4.0.1', 'Use assertListAllMatch() instead');
return static::assertListAllMatch($match, $dataObjectSet);
}