remove outdated test files
This commit is contained in:
parent
a383976e49
commit
6651d892dd
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -1 +0,0 @@
|
||||
reports/
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\Linkmobility4OXID\Tests\Integration\Application\Controller\Admin;
|
||||
|
||||
use D3\Linkmobility4OXID\Application\Controller\Admin\AdminOrder;
|
||||
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
|
||||
|
||||
class AdminOrderTest extends d3ModCfgUnitTestCase
|
||||
{
|
||||
/** @var AdminOrder */
|
||||
protected $controller;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->controller = oxNew(AdminOrder::class);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
unset($this->controller);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @return void
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public function testSend()
|
||||
{
|
||||
$this->callMethod(
|
||||
$this->controller,
|
||||
'send'
|
||||
);
|
||||
}
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\Linkmobility4OXID\Tests\Integration\Application\Model\MessageTypes;
|
||||
|
||||
use D3\Linkmobility4OXID\Application\Model\Configuration;
|
||||
use D3\Linkmobility4OXID\Application\Model\MessageTypes\Sms;
|
||||
use D3\ModCfg\Tests\unit\d3ModCfgUnitTestCase;
|
||||
use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberType;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
use OxidEsales\Eshop\Application\Model\Country;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\Remark;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\PayPalModule\Model\User;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use ReflectionException;
|
||||
|
||||
class SmsTest extends d3ModCfgUnitTestCase
|
||||
{
|
||||
/** @var Sms */
|
||||
protected $model;
|
||||
protected $countryId = 'countryIdNo1';
|
||||
protected $userId = 'userIdNo1';
|
||||
protected $exampleNumber;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->model = oxNew(Sms::class, 'demomessage');
|
||||
|
||||
$this->addObjects();
|
||||
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
|
||||
$this->exampleNumber = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
}
|
||||
|
||||
public function addObjects()
|
||||
{
|
||||
$country = oxNew(Country::class);
|
||||
$country->setId($this->countryId);
|
||||
$country->assign([
|
||||
'oxisoalpha2' => 'DE'
|
||||
]);
|
||||
$country->save();
|
||||
|
||||
//$user = new User();
|
||||
//$user->setId($this->userId);
|
||||
//$user->save();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
$this->clearObjects();
|
||||
|
||||
unset($this->model);
|
||||
}
|
||||
|
||||
public function clearObjects()
|
||||
{
|
||||
$country = oxNew(Country::class);
|
||||
$country->delete($this->countryId);
|
||||
|
||||
$user = oxNew(User::class);
|
||||
$user->delete($this->userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function testSendOrderMessage()
|
||||
{
|
||||
Registry::getConfig()->setConfigParam(Configuration::DEBUG, true);
|
||||
|
||||
/** @var User $user */
|
||||
//$user = oxNew(User::class);
|
||||
//$user->load($this->userId);
|
||||
|
||||
/** @var Order|MockObject $orderMock */
|
||||
$orderMock = $this->getMockBuilder(Order::class)
|
||||
->setMethods([
|
||||
'getFieldData',
|
||||
'getOrderUser'
|
||||
])
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$orderMock->method('getFieldData')->willReturnCallback([$this, 'orderFieldDataCallback']);
|
||||
$orderMock->method('getOrderUser')->willReturn($user);
|
||||
|
||||
$this->assertTrue(
|
||||
$this->callMethod(
|
||||
$this->model,
|
||||
'sendOrderMessage',
|
||||
[$orderMock]
|
||||
)
|
||||
);
|
||||
|
||||
$remark = oxNew(Remark::class);
|
||||
dumpvar($remark);
|
||||
// $remarkId = "SELECT oxid FROM ".$remark->getViewName()." WHERE "
|
||||
// $this->assertTrue(
|
||||
|
||||
// )
|
||||
}
|
||||
|
||||
public function orderFieldDataCallback()
|
||||
{
|
||||
$aArgs = func_get_args();
|
||||
|
||||
switch ($aArgs[0]) {
|
||||
case 'oxdelfon':
|
||||
case 'oxbillfon':
|
||||
return $this->exampleNumber;
|
||||
case 'oxdelcountryid':
|
||||
return $this->countryId;
|
||||
}
|
||||
|
||||
$this->fail('Unknown variable '.$aArgs[0]);
|
||||
}
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
# D3 Linkmobility4Oxid Tests
|
||||
|
||||
## Requirements
|
||||
|
||||
Both unit and acceptance tests require OXID Testing Library installed.
|
||||
See https://github.com/OXID-eSales/testing_library
|
||||
|
||||
### Configuration
|
||||
|
||||
Set up the module completely with your personal data (API Key, transmitter, country code). These will be used to test the successful configuration.
|
||||
|
||||
Please install the packages listed in the composer.json in "require-dev". Unfortunately Composer does not provide an automatic installation.
|
||||
|
||||
Here is an example of Testing Library configuration file `oxideshop/test_config.yml`
|
||||
|
||||
```
|
||||
# This file is auto-generated during the composer install
|
||||
mandatory_parameters:
|
||||
shop_path: /var/www/oxideshop/source
|
||||
shop_tests_path: /var/www/oxideshop/tests
|
||||
partial_module_paths: d3/linkmobilty
|
||||
optional_parameters:
|
||||
shop_url: null
|
||||
shop_serial: ''
|
||||
enable_varnish: false
|
||||
is_subshop: false
|
||||
install_shop: false
|
||||
remote_server_dir: null
|
||||
shop_setup_path: null
|
||||
restore_shop_after_tests_suite: false
|
||||
test_database_name: null
|
||||
restore_after_acceptance_tests: false
|
||||
restore_after_unit_tests: false
|
||||
tmp_path: /tmp/oxid_test_library/
|
||||
database_restoration_class: DatabaseRestorer
|
||||
activate_all_modules: false
|
||||
run_tests_for_shop: false
|
||||
run_tests_for_modules: true
|
||||
screen_shots_path: null
|
||||
screen_shots_url: null
|
||||
browser_name: firefox
|
||||
selenium_server_ip: 127.0.0.1
|
||||
selenium_server_port: '4444'
|
||||
additional_test_paths: null
|
||||
```
|
||||
|
||||
## Unit Tests
|
||||
|
||||
To execute unit tests run the following:
|
||||
|
||||
```
|
||||
cd /var/www/oxideshop/
|
||||
./vendor/bin/runtests
|
||||
```
|
||||
or for single tests
|
||||
```
|
||||
cd /var/www/oxideshop/
|
||||
./vendor/bin/runtests /var/www/html/vendor/d3/linkmobility4oxid/tests/...
|
||||
```
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Include modules test config
|
||||
namespace D3\Linkmobility4OXID\tests;
|
||||
|
||||
use D3\ModCfg\Tests\additional_abstract;
|
||||
use OxidEsales\Eshop\Core\Exception\StandardException;
|
||||
|
||||
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'd3linkmobility_config.php');
|
||||
|
||||
class additional extends additional_abstract
|
||||
{
|
||||
/**
|
||||
* additional constructor.
|
||||
* @throws StandardException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (D3LINKMOBILITY_REQUIRE_MODCFG) {
|
||||
$this->reactivateModCfg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oxNew(additional::class);
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
define('D3LINKMOBILTY_REQUIRE_MODCFG', true);
|
||||
|
@ -1,25 +0,0 @@
|
||||
<phpunit backupGlobals="true"
|
||||
backupStaticAttributes="false"
|
||||
cacheTokens="true"
|
||||
colors="false"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="false"
|
||||
convertWarningsToExceptions="true"
|
||||
forceCoversAnnotation="false"
|
||||
mapTestClassNameToCoveredClassName="false"
|
||||
processIsolation="false"
|
||||
stopOnError="false"
|
||||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
verbose="false">
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">../Application</directory>
|
||||
<directory suffix=".php">../Modules</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="junit" target="reports/logfile.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
Loading…
Reference in New Issue
Block a user