init
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
$rootDir = realpath(__DIR__ . '/../../../../../../../');
|
||||
$testsBaseDir = realpath(__DIR__ . '/../../../../');
|
||||
|
||||
require_once $rootDir . '/app/bootstrap.php';
|
||||
require_once $testsBaseDir . '/framework/autoload.php';
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
|
||||
colors="true"
|
||||
columns="max"
|
||||
beStrictAboutTestsThatDoNotTestAnything="false"
|
||||
bootstrap="./framework/bootstrap.php">
|
||||
<!-- Test suites definition -->
|
||||
<testsuites>
|
||||
<testsuite name="Unit Tests for Integration Tests Framework">
|
||||
<directory>testsuite</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<ini name="date.timezone" value="America/Los_Angeles"/>
|
||||
</php>
|
||||
<extensions>
|
||||
<extension class="Qameta\Allure\PHPUnit\AllureExtension">
|
||||
<!-- Optional arguments block; omit it if you want to use default values -->
|
||||
<arguments>
|
||||
<!-- Path to config file (default is config/allure.config.php) -->
|
||||
<string>../../../allure/allure.config.php</string>
|
||||
</arguments>
|
||||
</extension>
|
||||
</extensions>
|
||||
</phpunit>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestFramework\Test\Unit\Annotation;
|
||||
|
||||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
|
||||
|
||||
/**
|
||||
* Test for ReinstallInstance.
|
||||
*
|
||||
* @package Magento\TestFramework\Test\Unit\Annotation
|
||||
*/
|
||||
class ReinstallInstanceTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var \Magento\TestFramework\Annotation\ReinstallInstance
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var ObjectManagerHelper
|
||||
*/
|
||||
private $objectManagerHelper;
|
||||
|
||||
/**
|
||||
* @var \Magento\TestFramework\Application|\PHPUnit\Framework\MockObject\MockObject
|
||||
*/
|
||||
private $applicationMock;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->applicationMock = $this
|
||||
->getMockBuilder(\Magento\TestFramework\Application::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->objectManagerHelper = new ObjectManagerHelper($this);
|
||||
$this->model = $this->objectManagerHelper->getObject(
|
||||
\Magento\TestFramework\Annotation\ReinstallInstance::class,
|
||||
[
|
||||
'application' => $this->applicationMock
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function testEndTest()
|
||||
{
|
||||
$this->applicationMock->expects($this->once())
|
||||
->method('cleanup');
|
||||
$this->model->endTest();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user