浏览代码

É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é');
}
}

正在加载...
取消
保存