mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-10 00:16:13 +01:00
[TASK] Switch the functional tests to nimut/testing-framework
This commit is contained in:
parent
a8b687a656
commit
3cc3fd09b1
7 changed files with 31 additions and 44 deletions
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
<tx_tea_domain_model_testimonial>
|
||||
<uid>1</uid>
|
||||
<text>A very good Early Grey!</text>
|
||||
</tx_tea_domain_model_testimonial>
|
||||
</dataset>
|
|
@ -24,12 +24,12 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|||
*
|
||||
* @author Oliver Klee <typo3-coding@oliverklee.de>
|
||||
*/
|
||||
class TeaBeverageRepositoryTest extends \Tx_Phpunit_Database_TestCase
|
||||
class TeaBeverageRepositoryTest extends \Nimut\TestingFramework\TestCase\FunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
* @var string[]
|
||||
*/
|
||||
protected $backupGlobals = false;
|
||||
protected $testExtensionsToLoad = ['typo3conf/ext/tea'];
|
||||
|
||||
/**
|
||||
* @var TeaBeverageRepository|\PHPUnit_Framework_MockObject_MockObject
|
||||
|
@ -38,10 +38,7 @@ class TeaBeverageRepositoryTest extends \Tx_Phpunit_Database_TestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
if (!$this->createDatabase()) {
|
||||
self::markTestSkipped('Test database could not be created.');
|
||||
}
|
||||
$this->importExtensions(['tea']);
|
||||
parent::setUp();
|
||||
|
||||
/** @var ObjectManager $objectManager */
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
|
@ -50,12 +47,6 @@ class TeaBeverageRepositoryTest extends \Tx_Phpunit_Database_TestCase
|
|||
$this->subject = $objectManager->get(TeaBeverageRepository::class);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
$this->dropDatabase();
|
||||
$this->switchToTypo3Database();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
|
@ -24,26 +24,21 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|||
*
|
||||
* @author Oliver Klee <typo3-coding@oliverklee.de>
|
||||
*/
|
||||
class TestimonialRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
||||
class TestimonialRepositoryTest extends \Nimut\TestingFramework\TestCase\FunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
* @var string[]
|
||||
*/
|
||||
protected $backupGlobals = false;
|
||||
protected $testExtensionsToLoad = ['typo3conf/ext/tea'];
|
||||
|
||||
/**
|
||||
* @var TestimonialRepository
|
||||
*/
|
||||
protected $subject = null;
|
||||
|
||||
/**
|
||||
* @var \Tx_Phpunit_Framework
|
||||
*/
|
||||
protected $testingFramework = null;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->testingFramework = new \Tx_Phpunit_Framework('tx_tea');
|
||||
parent::setUp();
|
||||
|
||||
/** @var ObjectManager $objectManager */
|
||||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||
|
@ -52,11 +47,6 @@ class TestimonialRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
|||
$this->subject = $objectManager->get(TestimonialRepository::class);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
$this->testingFramework->cleanUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
@ -72,7 +62,8 @@ class TestimonialRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
|||
*/
|
||||
public function findAllWithOneRecordFindsThisRecord()
|
||||
{
|
||||
$uid = $this->testingFramework->createRecord('tx_tea_domain_model_testimonial');
|
||||
$this->importDataSet(__DIR__ . '/Fixtures/Testimonials.xml');
|
||||
$uid = 1;
|
||||
|
||||
$container = $this->subject->findAll();
|
||||
/** @var Testimonial $first */
|
||||
|
@ -87,15 +78,14 @@ class TestimonialRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
|||
*/
|
||||
public function findByUidForExistingRecordReturnsModelWithData()
|
||||
{
|
||||
$text = 'A very good Early Grey!';
|
||||
$uid = $this->testingFramework->createRecord(
|
||||
'tx_tea_domain_model_testimonial', ['text' => $text]
|
||||
);
|
||||
$this->importDataSet(__DIR__ . '/Fixtures/Testimonials.xml');
|
||||
$uid = 1;
|
||||
|
||||
/** @var Testimonial $model */
|
||||
$model = $this->subject->findByUid($uid);
|
||||
|
||||
self::assertNotNull($model);
|
||||
$text = 'A very good Early Grey!';
|
||||
self::assertSame($text, $model->getText());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,12 +22,12 @@ use org\bovigo\vfs\vfsStreamDirectory;
|
|||
*
|
||||
* @author Oliver Klee <typo3-coding@oliverklee.de>
|
||||
*/
|
||||
class FileUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
||||
class FileUtilityTest extends \Nimut\TestingFramework\TestCase\FunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
* @var string[]
|
||||
*/
|
||||
protected $backupGlobals = false;
|
||||
protected $testExtensionsToLoad = ['typo3conf/ext/tea'];
|
||||
|
||||
/**
|
||||
* @var \OliverKlee\Tea\Utility\FileUtility
|
||||
|
@ -49,6 +49,8 @@ class FileUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->root = vfsStream::setup('home');
|
||||
$this->targetFilePath = vfsStream::url('home/target.txt');
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
"require-dev": {
|
||||
"namelesscoder/typo3-repository-client": "^1.2.0",
|
||||
"nimut/testing-framework": "^2.0.0",
|
||||
"typo3-ter/phpunit": "*",
|
||||
"phpunit/phpunit": "^5.7.0",
|
||||
"mikey179/vfsStream": "^1.6.0"
|
||||
},
|
||||
|
|
|
@ -125,7 +125,7 @@ CREATE TABLE tx_tea_domain_model_testimonial (
|
|||
|
||||
teabeverage int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
|
||||
date_of_posting datetime DEFAULT '0000-00-00 00:00:00',
|
||||
date_of_posting int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
number_of_consumed_cups int(11) DEFAULT '0' NOT NULL,
|
||||
text text NOT NULL,
|
||||
|
||||
|
@ -133,7 +133,6 @@ CREATE TABLE tx_tea_domain_model_testimonial (
|
|||
crdate int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||||
is_dummy_record tinyint(1) unsigned DEFAULT '0' NOT NULL,
|
||||
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||||
starttime int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
endtime int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
|
@ -156,8 +155,7 @@ CREATE TABLE tx_tea_domain_model_testimonial (
|
|||
PRIMARY KEY (uid),
|
||||
KEY parent (pid),
|
||||
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
|
||||
KEY language (l10n_parent,sys_language_uid),
|
||||
KEY phpunit_dummy (is_dummy_record)
|
||||
KEY language (l10n_parent,sys_language_uid)
|
||||
);
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue