Definition at line 15 of file BootstrapTest.php.
◆ setUp()
Definition at line 44 of file BootstrapTest.php.
46 $this->_application = $this->createPartialMock(
47 \
Magento\TestFramework\Application::class,
48 [
'getTempDir',
'getInitParams',
'reinitialize',
'run']
50 $this->_bootstrap = $this->createPartialMock(
51 \
Magento\TestFramework\Bootstrap::class,
52 [
'getApplication',
'getDbVendorName']
54 $this->_bootstrap->expects(
59 $this->returnValue($this->_application)
61 $this->_object = new \Magento\TestFramework\Helper\Bootstrap($this->_bootstrap);
◆ tearDown()
Definition at line 64 of file BootstrapTest.php.
66 $this->_application =
null;
67 $this->_bootstrap =
null;
68 $this->_object =
null;
◆ testCanTestHeaders()
Definition at line 104 of file BootstrapTest.php.
108 \
Magento\TestFramework\Helper\Bootstrap::canTestHeaders(),
109 'Expected inability to test headers.' 113 $expectedHeader =
'SomeHeader: header-value';
114 $expectedCookie =
'Set-Cookie: SomeCookie=cookie-value';
117 $actualHeaders = xdebug_get_headers();
118 $this->assertNotContains($expectedHeader, $actualHeaders);
119 $this->assertNotContains($expectedCookie, $actualHeaders);
122 $expectedCanTest =
true;
124 function () use (&$expectedCanTest) {
125 $expectedCanTest =
false;
128 header($expectedHeader);
130 restore_error_handler();
132 $this->assertEquals($expectedCanTest, \
Magento\TestFramework\Helper\Bootstrap::canTestHeaders());
134 if ($expectedCanTest) {
135 $actualHeaders = xdebug_get_headers();
136 $this->assertContains($expectedHeader, $actualHeaders);
137 $this->assertContains($expectedCookie, $actualHeaders);
setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly)
◆ testGetAppInitParams()
Definition at line 147 of file BootstrapTest.php.
149 $this->_application->expects(
154 $this->returnValue($this->_fixtureInitParams)
156 $this->assertEquals($this->_fixtureInitParams, $this->_object->getAppInitParams());
◆ testGetAppTempDir()
Definition at line 141 of file BootstrapTest.php.
143 $this->_application->expects($this->once())->method(
'getTempDir')->will($this->returnValue(
__DIR__));
144 $this->assertEquals(
__DIR__, $this->_object->getAppTempDir());
defined('TESTS_BP')||define('TESTS_BP' __DIR__
◆ testGetInstanceAllowed()
@depends testSetInstanceFirstAllowed
Definition at line 89 of file BootstrapTest.php.
91 $this->assertSame($expectedInstance, \
Magento\TestFramework\Helper\Bootstrap::getInstance());
◆ testGetInstanceEmptyProhibited()
testGetInstanceEmptyProhibited |
( |
| ) |
|
@expectedException \Magento\Framework\Exception\LocalizedException @expectedExceptionMessage Helper instance is not defined yet.
Definition at line 75 of file BootstrapTest.php.
◆ testReinitialize()
Definition at line 159 of file BootstrapTest.php.
161 $this->_application->expects($this->once())->method(
'reinitialize')->with($this->_fixtureInitParams);
162 $this->_object->reinitialize($this->_fixtureInitParams);
◆ testRunApp()
Definition at line 165 of file BootstrapTest.php.
167 $this->_application->expects($this->once())->method(
'run');
168 $this->_object->runApp();
◆ testSetInstanceChangeProhibited()
testSetInstanceChangeProhibited |
( |
| ) |
|
@depends testSetInstanceFirstAllowed @expectedException \Magento\Framework\Exception\LocalizedException @expectedExceptionMessage Helper instance cannot be redefined.
Definition at line 99 of file BootstrapTest.php.
static setInstance(\Magento\TestFramework\Helper\Bootstrap $instance)
◆ testSetInstanceFirstAllowed()
testSetInstanceFirstAllowed |
( |
| ) |
|
Definition at line 80 of file BootstrapTest.php.
static setInstance(\Magento\TestFramework\Helper\Bootstrap $instance)
◆ $_application
◆ $_bootstrap
◆ $_fixtureInitParams
◆ $_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/Helper/BootstrapTest.php