Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
DbIsolationTest Class Reference
Inheritance diagram for DbIsolationTest:

Public Member Functions

 testStartTestTransactionRequestClassIsolationEnabled ()
 
 testStartTestTransactionRequestMethodIsolationEnabled ()
 
 testStartTestTransactionRequestMethodIsolationDisabled ()
 
 testStartTestTransactionRequestInvalidAnnotation ()
 
 testStartTestTransactionRequestAmbiguousAnnotation ()
 
 testEndTestTransactionRequestMethodIsolationEnabled ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $_object
 

Detailed Description

Test class for \Magento\TestFramework\Annotation\DbIsolation.

@magentoDbIsolation enabled

Definition at line 13 of file DbIsolationTest.php.

Member Function Documentation

◆ setUp()

setUp ( )
protected

Definition at line 20 of file DbIsolationTest.php.

21  {
22  $this->_object = new \Magento\TestFramework\Annotation\DbIsolation();
23  }

◆ testEndTestTransactionRequestMethodIsolationEnabled()

testEndTestTransactionRequestMethodIsolationEnabled ( )

@magentoDbIsolation enabled

Definition at line 86 of file DbIsolationTest.php.

87  {
88  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
89  $this->_object->endTestTransactionRequest($this, $eventParam);
90  $this->assertFalse($eventParam->isTransactionStartRequested());
91  $this->assertFalse($eventParam->isTransactionRollbackRequested());
92 
93  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
94  $this->_object->startTransaction($this);
95  $this->_object->endTestTransactionRequest($this, $eventParam);
96  $this->assertFalse($eventParam->isTransactionStartRequested());
97  $this->assertTrue($eventParam->isTransactionRollbackRequested());
98  }

◆ testStartTestTransactionRequestAmbiguousAnnotation()

testStartTestTransactionRequestAmbiguousAnnotation ( )

@magentoDbIsolation enabled @magentoDbIsolation disabled @expectedException \Magento\Framework\Exception\LocalizedException

Definition at line 78 of file DbIsolationTest.php.

79  {
80  $this->_object->startTestTransactionRequest($this, new \Magento\TestFramework\Event\Param\Transaction());
81  }

◆ testStartTestTransactionRequestClassIsolationEnabled()

testStartTestTransactionRequestClassIsolationEnabled ( )

Definition at line 25 of file DbIsolationTest.php.

26  {
27  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
28  $this->_object->startTestTransactionRequest($this, $eventParam);
29  $this->assertTrue($eventParam->isTransactionStartRequested());
30  $this->assertFalse($eventParam->isTransactionRollbackRequested());
31 
32  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
33  $this->_object->startTransaction($this);
34  $this->_object->startTestTransactionRequest($this, $eventParam);
35  $this->assertFalse($eventParam->isTransactionStartRequested());
36  $this->assertFalse($eventParam->isTransactionRollbackRequested());
37  }

◆ testStartTestTransactionRequestInvalidAnnotation()

testStartTestTransactionRequestInvalidAnnotation ( )

@magentoDbIsolation invalid @expectedException \Magento\Framework\Exception\LocalizedException

Definition at line 68 of file DbIsolationTest.php.

69  {
70  $this->_object->startTestTransactionRequest($this, new \Magento\TestFramework\Event\Param\Transaction());
71  }

◆ testStartTestTransactionRequestMethodIsolationDisabled()

testStartTestTransactionRequestMethodIsolationDisabled ( )

@magentoDbIsolation disabled

Definition at line 50 of file DbIsolationTest.php.

51  {
52  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
53  $this->_object->startTestTransactionRequest($this, $eventParam);
54  $this->assertFalse($eventParam->isTransactionStartRequested());
55  $this->assertFalse($eventParam->isTransactionRollbackRequested());
56 
57  $eventParam = new \Magento\TestFramework\Event\Param\Transaction();
58  $this->_object->startTransaction($this);
59  $this->_object->startTestTransactionRequest($this, $eventParam);
60  $this->assertFalse($eventParam->isTransactionStartRequested());
61  $this->assertTrue($eventParam->isTransactionRollbackRequested());
62  }

◆ testStartTestTransactionRequestMethodIsolationEnabled()

testStartTestTransactionRequestMethodIsolationEnabled ( )

@magentoDbIsolation enabled

Definition at line 42 of file DbIsolationTest.php.

Field Documentation

◆ $_object

$_object
protected

Definition at line 18 of file DbIsolationTest.php.


The documentation for this class was generated from the following file: