Rename tests according to the class the class they are testing

This commit is contained in:
Adrien Crivelli 2017-11-03 12:47:19 +09:00
parent 98b532102d
commit 40efcd2fdd
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
7 changed files with 21 additions and 37 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests;
namespace PhpOffice\PhpSpreadsheetTests\Sample;
use PhpOffice\PhpSpreadsheet\Helper\Sample;
use PHPUnit_Framework_TestCase;

View File

@ -5,7 +5,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Reader;
use PhpOffice\PhpSpreadsheet\Reader\Html;
use PHPUnit_Framework_TestCase;
class HTMLTest extends PHPUnit_Framework_TestCase
class HtmlTest extends PHPUnit_Framework_TestCase
{
public function testCsvWithAngleBracket()
{

View File

@ -5,7 +5,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Reader;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PHPUnit_Framework_TestCase;
class XLSXTest extends PHPUnit_Framework_TestCase
class XlsxTest extends PHPUnit_Framework_TestCase
{
/**
* Test load Xlsx file without cell reference.

View File

@ -1,32 +0,0 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests\Style;
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use PHPUnit_Framework_TestCase;
class NumberFormatDateTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
StringHelper::setDecimalSeparator('.');
StringHelper::setThousandsSeparator(',');
}
/**
* @dataProvider providerNumberFormat
*
* @param mixed $expectedResult
*/
public function testFormatValueWithMask($expectedResult, ...$args)
{
$result = NumberFormat::toFormattedString(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerNumberFormat()
{
return require 'data/Style/NumberFormatDates.php';
}
}

View File

@ -29,4 +29,20 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase
{
return require 'data/Style/NumberFormat.php';
}
/**
* @dataProvider providerNumberFormatDates
*
* @param mixed $expectedResult
*/
public function testFormatValueWithMaskDate($expectedResult, ...$args)
{
$result = NumberFormat::toFormattedString(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerNumberFormatDates()
{
return require 'data/Style/NumberFormatDates.php';
}
}

View File

@ -7,7 +7,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\ColumnCellIterator;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PHPUnit_Framework_TestCase;
class WorksheetColumnTest extends PHPUnit_Framework_TestCase
class ColumnTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockColumn;

View File

@ -7,7 +7,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\RowCellIterator;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PHPUnit_Framework_TestCase;
class WorksheetRowTest extends PHPUnit_Framework_TestCase
class RowTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockRow;