Unit test & more

PATH=$PATH:~/.composer/vendor/bin
export PATH
phpunit
codecept
selenium-server-standalone

_______________________________________________
(phpunit ^6.*)
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
    class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');


Unit Test

composer global require "codeception/codeception" --dev
composer global require "codeception/specify=*"
composer global require "codeception/verify=*"
composer global status

> composer global status
Changed current directory to C:/Users/des1roer/AppData/Roaming/Composer
No local changes


vendor/bin/phpunit common/tests/unit/models/FirstTest.php

php vendor/codeception/codeception/codecept run common/tests/unit/models/FirstTest.php


~$ PATH=$PATH:~/.composer/vendor/bin
~$ export PATH


---------------------------------------
php vendor/bin/codecept run
---------------------------------------
php vendor/bin/phpunit run frontend/tests/unit/entities/Movie/CreateTest.php
---------------------------------------



<?php
namespace common\tests\unit;

use PHPUnit\Framework\TestCase;

class SecondTest extends TestCase
{
    public function testMaths()
    {
        $result = 2+2;
        $this->assertEquals($result, 4);
    }

    public function testTrue()
    {
        $this->assertTrue(true);
    }
}

Комментариев нет:

Отправить комментарий

JavaScript learn

Чтобы вставить элемент после какого-то элемента, нужно создать прототип. Element.prototype.appendAfter = function (element) { element.paren...