Skip to content

Commit

Permalink
16-08-2022 - Базовые Unit тесты для интерактивной карты локации Завод…
Browse files Browse the repository at this point in the history
… завершены
  • Loading branch information
PC-Principal committed Aug 16, 2022
1 parent 5ad5f8d commit f80916c
Show file tree
Hide file tree
Showing 17 changed files with 161 additions and 348 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ ENVIRONMENT=dev

# Database
# ---------------------
DB_DSN=pgsql:host=db;dbname=staff_list
DB_DSN=mysql:host=localhost;dbname=staff_list
DB_NAME=here_db_name
DB_USER=user_test
DB_PASSWORD=password_test
DB_CHARSET=utf8

# Database - unit, functional, other tests
DB_TEST_DSN=pgsql:host=db;dbname=test_migrations_db
DB_TEST_DSN=mysql:host=localhost;dbname=test_migrations_db
DB_TEST_NAME=here_db_name
DB_TEST_USER=user_test
DB_TEST_PASSWORD=password_test
Expand Down
2 changes: 1 addition & 1 deletion config/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'showScriptName' => true,
],
'user' => [
'identityClass' => 'app\models\User',
'identityClass' => 'app\models\Admins',
],
'request' => [
'cookieValidationKey' => 'test',
Expand Down
2 changes: 1 addition & 1 deletion config/test_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
'dsn' => $_ENV['DB_TEST_DSN'],
'username' => $_ENV['DB_TEST_USER'],
'password' => $_ENV['DB_TEST_PASSWORD'],
'charset' => $_ENV['DB_TEST_CHARSET'],
'charset' => $_ENV['DB_TEST_CHARSET']
];
3 changes: 2 additions & 1 deletion tests/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
defined('YII_DEBUG') or define('YII_DEBUG', true);

require_once __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
require __DIR__ .'/../vendor/autoload.php';
require __DIR__ .'/../vendor/autoload.php';
require_once(__DIR__ . '/../common/env.php');
44 changes: 44 additions & 0 deletions tests/_data/zavod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Created by PhpStorm.
* User: PC_Principal
* Date: 16.08.2022
* Time: 20:39
*
* Фикстуры для интерактивных карт
*/
return [
[
'name' => 'Ящик у выхода 234234с локации',
'marker_group'=>'Военн234234ые ящики',
'coords_x'=>'1333',
'coords_y'=>'-1235',
'content'=>'<p>Это основной выхо34234234д с локации Завод, если у вас нет ключа от выхода с завода - это ваш единственный способ выйти с карты.</p><p><img alt="Основной выход с локации Завод. Через него выходит основная часть игроков." src="/img/upload/bereg_images/vihod-s-karty.png" style="width:100%" /></p>',
'enabled'=>'0',
'customicon'=>'/img/orota_3_d.png',
'exits_group'=>'Другое значение',
'exit_anyway'=>'0'
],
[
'name' => 'Ящик у выхода 234234с локации',
'marker_group'=>'Военн234234ые ящики',
'coords_x'=>'140',
'coords_y'=>'-135',
'content'=>'<p>Это основной выхо34234234д с локации Завод, если у вас нет ключа от выхода с завода - это ваш единственный способ выйти с карты.</p><p><img alt="Основной выход с локации Завод. Через него выходит основная часть игроков." src="/img/upload/bereg_images/vihod-s-karty.png" style="width:100%" /></p>',
'enabled'=>'0',
'customicon'=>'/img/orota_3_d.png',
'exits_group'=>'Другое значение',
'exit_anyway'=>'0'
],
[
'name' => 'Ящик у выхода 234234с локации',
'marker_group'=>'Военн234234ые ящики',
'coords_x'=>'1550',
'coords_y'=>'-135',
'content'=>'<p>Это основной выхо34234234д с локации Завод, если у вас нет ключа от выхода с завода - это ваш единственный способ выйти с карты.</p><p><img alt="Основной выход с локации Завод. Через него выходит основная часть игроков." src="/img/upload/bereg_images/vihod-s-karty.png" style="width:100%" /></p>',
'enabled'=>'0',
'customicon'=>'/img/orota_3_d.png',
'exits_group'=>'Другое значение',
'exit_anyway'=>'0'
]
];
12 changes: 0 additions & 12 deletions tests/acceptance/AboutCest.php

This file was deleted.

34 changes: 0 additions & 34 deletions tests/acceptance/ContactCest.php

This file was deleted.

18 changes: 0 additions & 18 deletions tests/acceptance/HomeCest.php

This file was deleted.

21 changes: 0 additions & 21 deletions tests/acceptance/LoginCest.php

This file was deleted.

24 changes: 24 additions & 0 deletions tests/fixtures/ZavodFixture.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: PC_Principal
* Date: 16.08.2022
* Time: 20:49
*
* Фикстура маркеров локации Завод
*/

namespace app\tests\fixtures;

class ZavodFixture extends \yii\test\ActiveFixture {

public $modelClass = 'app\models\Zavod';

/** @var string Имя таблицы */
const TABLE_NAME = 'zavod';

public function afterLoad() {
parent::afterLoad();
$this->db->createCommand()->setSql('truncate table .'.static::TABLE_NAME)->execute();
}
}
57 changes: 0 additions & 57 deletions tests/functional/ContactFormCest.php

This file was deleted.

59 changes: 0 additions & 59 deletions tests/functional/LoginFormCest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ modules:
enabled:
- Asserts
- Yii2:
part: [orm, email]
part: [orm, email, fixtures]
45 changes: 0 additions & 45 deletions tests/unit/models/ContactFormTest.php

This file was deleted.

Loading

0 comments on commit f80916c

Please sign in to comment.