Test class for \Magento\TestFramework\Annotation\DataFixture.
@magentoDataFixture sampleFixtureOne
Definition at line 13 of file DataFixtureTest.php.
◆ sampleFixtureOne()
static sampleFixtureOne |
( |
| ) |
|
|
static |
◆ sampleFixtureTwo()
static sampleFixtureTwo |
( |
| ) |
|
|
static |
◆ sampleFixtureTwoRollback()
static sampleFixtureTwoRollback |
( |
| ) |
|
|
static |
◆ setUp()
Definition at line 20 of file DataFixtureTest.php.
22 $this->_object = $this->getMockBuilder(\
Magento\TestFramework\Annotation\DataFixture::class)
23 ->setMethods([
'_applyOneFixture'])
24 ->setConstructorArgs([
__DIR__ .
'/_files'])
defined('TESTS_BP')||define('TESTS_BP' __DIR__
◆ testConstructorException()
testConstructorException |
( |
| ) |
|
@expectedException \Magento\Framework\Exception\LocalizedException
Definition at line 43 of file DataFixtureTest.php.
45 new \Magento\TestFramework\Annotation\DataFixture(
__DIR__ .
'/non_existing_fixture_dir');
defined('TESTS_BP')||define('TESTS_BP' __DIR__
◆ testDisabledDbIsolation()
testDisabledDbIsolation |
( |
| ) |
|
@magentoDbIsolation disabled @magentoDataFixture sampleFixtureTwo @magentoDataFixture path/to/fixture/script.php
Definition at line 84 of file DataFixtureTest.php.
86 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
87 $this->_object->startTestTransactionRequest($this, $eventParam);
88 $this->assertFalse($eventParam->isTransactionStartRequested());
89 $this->assertFalse($eventParam->isTransactionRollbackRequested());
91 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
92 $this->_object->startTransaction($this);
93 $this->_object->startTestTransactionRequest($this, $eventParam);
94 $this->assertFalse($eventParam->isTransactionStartRequested());
95 $this->assertFalse($eventParam->isTransactionRollbackRequested());
◆ testEndTestTransactionRequestMethodAnnotation()
testEndTestTransactionRequestMethodAnnotation |
( |
| ) |
|
@magentoDataFixture sampleFixtureTwo @magentoDataFixture path/to/fixture/script.php
Definition at line 111 of file DataFixtureTest.php.
113 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
114 $this->_object->endTestTransactionRequest($this, $eventParam);
115 $this->assertFalse($eventParam->isTransactionStartRequested());
116 $this->assertFalse($eventParam->isTransactionRollbackRequested());
118 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
119 $this->_object->startTransaction($this);
120 $this->_object->endTestTransactionRequest($this, $eventParam);
121 $this->assertFalse($eventParam->isTransactionStartRequested());
122 $this->assertTrue($eventParam->isTransactionRollbackRequested());
◆ testRollbackTransactionRevertFixtureFile()
testRollbackTransactionRevertFixtureFile |
( |
| ) |
|
@magentoDataFixture path/to/fixture/script.php @magentoDataFixture sample_fixture_two.php
Definition at line 169 of file DataFixtureTest.php.
171 $this->_object->startTransaction($this);
172 $this->_object->expects(
177 $this->stringEndsWith(
'sample_fixture_two_rollback.php')
179 $this->_object->rollbackTransaction();
◆ testRollbackTransactionRevertFixtureMethod()
testRollbackTransactionRevertFixtureMethod |
( |
| ) |
|
@magentoDataFixture sampleFixtureOne @magentoDataFixture sampleFixtureTwo
Definition at line 152 of file DataFixtureTest.php.
154 $this->_object->startTransaction($this);
155 $this->_object->expects(
160 [__CLASS__,
'sampleFixtureTwoRollback']
162 $this->_object->rollbackTransaction();
◆ testStartTestTransactionRequestClassAnnotation()
testStartTestTransactionRequestClassAnnotation |
( |
| ) |
|
Definition at line 48 of file DataFixtureTest.php.
50 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
51 $this->_object->startTestTransactionRequest($this, $eventParam);
52 $this->assertTrue($eventParam->isTransactionStartRequested());
53 $this->assertFalse($eventParam->isTransactionRollbackRequested());
55 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
56 $this->_object->startTransaction($this);
57 $this->_object->startTestTransactionRequest($this, $eventParam);
58 $this->assertTrue($eventParam->isTransactionStartRequested());
◆ testStartTestTransactionRequestInvalidPath()
testStartTestTransactionRequestInvalidPath |
( |
| ) |
|
@magentoDataFixture fixture\path\must\not\contain\backslash.php @expectedException \Magento\Framework\Exception\LocalizedException
Definition at line 102 of file DataFixtureTest.php.
104 $this->_object->startTestTransactionRequest($this,
new \
Magento\TestFramework\Event\Param\Transaction());
◆ testStartTestTransactionRequestMethodAnnotation()
testStartTestTransactionRequestMethodAnnotation |
( |
| ) |
|
@magentoDataFixture sampleFixtureTwo @magentoDataFixture path/to/fixture/script.php
Definition at line 65 of file DataFixtureTest.php.
67 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
68 $this->_object->startTestTransactionRequest($this, $eventParam);
69 $this->assertTrue($eventParam->isTransactionStartRequested());
70 $this->assertFalse($eventParam->isTransactionRollbackRequested());
72 $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
73 $this->_object->startTransaction($this);
74 $this->_object->startTestTransactionRequest($this, $eventParam);
75 $this->assertTrue($eventParam->isTransactionStartRequested());
76 $this->assertFalse($eventParam->isTransactionRollbackRequested());
◆ testStartTransactionClassAnnotation()
testStartTransactionClassAnnotation |
( |
| ) |
|
Definition at line 125 of file DataFixtureTest.php.
127 $this->_object->expects($this->once())->method(
'_applyOneFixture')->with([__CLASS__,
'sampleFixtureOne']);
128 $this->_object->startTransaction($this);
◆ testStartTransactionMethodAnnotation()
testStartTransactionMethodAnnotation |
( |
| ) |
|
@magentoDataFixture sampleFixtureTwo @magentoDataFixture path/to/fixture/script.php
Definition at line 135 of file DataFixtureTest.php.
137 $this->_object->expects($this->at(0))->method(
'_applyOneFixture')->with([__CLASS__,
'sampleFixtureTwo']);
138 $this->_object->expects(
143 $this->stringEndsWith(
'path/to/fixture/script.php')
145 $this->_object->startTransaction($this);
◆ $_object
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DataFixtureTest.php