22 $this->_object = $this->getMockBuilder(\
Magento\TestFramework\Annotation\DataFixture::class)
23 ->setMethods([
'_applyOneFixture'])
24 ->setConstructorArgs([
__DIR__ .
'/_files'])
45 new \Magento\TestFramework\Annotation\DataFixture(
__DIR__ .
'/non_existing_fixture_dir');
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());
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());
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());
104 $this->_object->startTestTransactionRequest($this,
new \
Magento\TestFramework\Event\Param\Transaction());
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());
127 $this->_object->expects($this->once())->method(
'_applyOneFixture')->with([__CLASS__,
'sampleFixtureOne']);
128 $this->_object->startTransaction($this);
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);
154 $this->_object->startTransaction($this);
155 $this->_object->expects(
160 [__CLASS__,
'sampleFixtureTwoRollback']
162 $this->_object->rollbackTransaction();
171 $this->_object->startTransaction($this);
172 $this->_object->expects(
177 $this->stringEndsWith(
'sample_fixture_two_rollback.php')
179 $this->_object->rollbackTransaction();
testEndTestTransactionRequestMethodAnnotation()
static sampleFixtureOne()
testStartTestTransactionRequestInvalidPath()
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testStartTransactionMethodAnnotation()
testStartTestTransactionRequestClassAnnotation()
testRollbackTransactionRevertFixtureFile()
testStartTestTransactionRequestMethodAnnotation()
static sampleFixtureTwo()
testStartTransactionClassAnnotation()
testConstructorException()
testDisabledDbIsolation()
static sampleFixtureTwoRollback()
testRollbackTransactionRevertFixtureMethod()