瀏覽代碼

Écrire un premier test unitaire #1300

feature/souke
Guillaume Bourgeois 1 年之前
父節點
當前提交
b118415226
共有 3 個檔案被更改,包括 3302 行新增1 行删除
  1. +3270
    -1
      tests/codeception/common/_support/_generated/UnitTesterActions.php
  2. +7
    -0
      tests/codeception/common/unit.suite.yml
  3. +25
    -0
      tests/codeception/common/unit/ExampleTest.php

+ 3270
- 1
tests/codeception/common/_support/_generated/UnitTesterActions.php
文件差異過大導致無法顯示
查看文件


+ 7
- 0
tests/codeception/common/unit.suite.yml 查看文件

@@ -4,3 +4,10 @@
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.

class_name: UnitTester
modules:
enabled:
- Asserts
- Yii2
config:
Yii2:
configFile: '../config/common/unit.php'

+ 25
- 0
tests/codeception/common/unit/ExampleTest.php 查看文件

@@ -0,0 +1,25 @@
<?php

namespace tests\codeception\common\unit;

//use \Tests\Support\UnitTester;

use common\logic\Producer\Producer\Model\Producer;
use common\logic\Producer\Producer\Wrapper\ProducerContainer;
use tests\codeception\common\UnitTester;

class ExampleTest extends \Codeception\Test\Unit
{
protected UnitTester $tester;

protected function _before()
{
}

public function testMe()
{
$producerContainer = ProducerContainer::getInstance();
$producer = $producerContainer->getBuilder()->instanciateProducer();
$this->assertTrue($producer instanceof Producer, 'Producer instancié');
}
}

Loading…
取消
儲存