mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
parent
1f7adab62e
commit
ab566b0a15
@ -23,16 +23,19 @@ class Module implements Serializable
|
||||
|
||||
/**
|
||||
* Return value of getCIConfig() when module uses PHPUNit 9
|
||||
* @deprecated 4.13.0 Will be removed without equivalent functionality
|
||||
*/
|
||||
const CI_PHPUNIT_NINE = 'CI_PHPUNIT_NINE';
|
||||
|
||||
/**
|
||||
* Return value of getCIConfig() when module uses PHPUNit 5
|
||||
* @deprecated 4.13.0 Will be removed without equivalent functionality
|
||||
*/
|
||||
const CI_PHPUNIT_FIVE = 'CI_PHPUNIT_FIVE';
|
||||
|
||||
/**
|
||||
* Return value of getCIConfig() when module does not use any CI
|
||||
* @deprecated 4.13.0 Will be removed without equivalent functionality
|
||||
*/
|
||||
const CI_UNKNOWN = 'CI_UNKNOWN';
|
||||
|
||||
|
@ -31,6 +31,7 @@ use SilverStripe\Control\Director;
|
||||
* $obj->write();
|
||||
* }
|
||||
* </code>
|
||||
* @deprecated 4.13.0 Use League\Csv\Reader instead
|
||||
*/
|
||||
class CSVParser implements Iterator
|
||||
{
|
||||
@ -115,7 +116,7 @@ class CSVParser implements Iterator
|
||||
*/
|
||||
public function __construct($filename, $delimiter = ",", $enclosure = '"')
|
||||
{
|
||||
Deprecation::notice('5.0', __CLASS__ . ' is deprecated, use ' . Reader::class . ' instead');
|
||||
Deprecation::notice('4.13.0', 'Use ' . Reader::class . ' instead', Deprecation::SCOPE_CLASS);
|
||||
$filename = Director::getAbsFile($filename);
|
||||
$this->filename = $filename;
|
||||
$this->delimiter = $delimiter;
|
||||
|
@ -254,11 +254,11 @@ class CsvBulkLoader extends BulkLoader
|
||||
Deprecation::notice('4.12.0', 'Process rows individually instead');
|
||||
$results = BulkLoader_Result::create();
|
||||
|
||||
$csv = new CSVParser(
|
||||
$filepath,
|
||||
$this->delimiter,
|
||||
$this->enclosure
|
||||
);
|
||||
$delimiter = $this->delimiter;
|
||||
$enclosure = $this->enclosure;
|
||||
$csv = Deprecation::withNoReplacement(function () use ($filepath, $delimiter, $enclosure) {
|
||||
return new CSVParser($filepath, $delimiter, $enclosure);
|
||||
});
|
||||
|
||||
// ColumnMap has two uses, depending on whether hasHeaderRow is set
|
||||
if ($this->columnMap) {
|
||||
|
@ -6,6 +6,7 @@ use SilverStripe\Control\HTTPResponse;
|
||||
|
||||
/**
|
||||
* Wrapper around HTTPResponse to make it look like a SimpleHTTPResposne
|
||||
* @deprecated 4.13.0 Will be removed without equivalent functionality to replace it
|
||||
*/
|
||||
class TestSession_STResponseWrapper
|
||||
{
|
||||
@ -17,6 +18,13 @@ class TestSession_STResponseWrapper
|
||||
|
||||
public function __construct(HTTPResponse $response)
|
||||
{
|
||||
Deprecation::withNoReplacement(function () {
|
||||
Deprecation::notice(
|
||||
'4.13.0',
|
||||
'Will be removed without equivalent functionality to replace it',
|
||||
Deprecation::SCOPE_CLASS
|
||||
);
|
||||
});
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace SilverStripe\Dev\Tests;
|
||||
|
||||
use SilverStripe\Dev\CSVParser;
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
|
||||
class CSVParserTest extends SapphireTest
|
||||
@ -19,6 +20,9 @@ class CSVParserTest extends SapphireTest
|
||||
{
|
||||
parent::setUp();
|
||||
$this->csvPath = __DIR__ . '/CsvBulkLoaderTest/csv/';
|
||||
if (Deprecation::isEnabled()) {
|
||||
$this->markTestSkipped('Test calls deprecated code');
|
||||
}
|
||||
}
|
||||
|
||||
public function testParsingWithHeaders()
|
||||
|
Loading…
Reference in New Issue
Block a user