承接 komex/unteist 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

komex/unteist

Composer 安装命令:

composer require --dev komex/unteist

包简介

Unit test framework

README 文档

README

#Unteist

Unteist is a unit test framework for developers and testers that makes the writing of tests easy and gets its result more quickly than ever. It does not load all tests collections to memory but does it step-by-step. One process - one test case in memory. You can use up to 10 processes for testing. Framework is more flexible in configuration of tests, test cases and suites than "the de-facto standard for unit testing in PHP projects".

Build Status

Requirements

  • Unteist requires PHP 5.4 (or later).
  • (Optional) pcntl module if you want to run tests in multiple processes.

Installation

To add Unteist as a dependency to your project, simply add a dependency on komex/unteist to your project's composer.json file. Here is a minimal example of a composer.json file:

    {
        "require": {
            "komex/unteist": "1.0.*"
        }
    }

Unteist may generate reports in HTML format. Right now, reports are very simple, but it may be more complex in future. So, framework needs Bootstrap, lessphp and jQuery for working.

Writing tests

You can place your tests in any directory as you wish, but storing it in tests directory is a good practice. There is no problems with understanding how to write tests if you have already worked with PHPUnit.

  • The tests for a class Class go into a class ClassTest.
  • ClassTest inherits from \Unteist\TestCase.
  • The tests are public methods that are named test*. Alternatively, you can use the @test annotation in a method's docblock to mark it as a test method.
  • Inside the test methods, assertion methods such as \Unteist\Assert\Assert::equals() are used to assert that an actual value matches an expected value.

Example

<?php

use \Unteist\Assert\Assert;

class StackTest extends \Unteist\TestCase
{
    public function testPushAndPop()
    {
        $stack = array();
        Assert::equals(0, count($stack));

        array_push($stack, 'foo');
        Assert::equals('foo', $stack[count($stack)-1]);
        Assert::equals(1, count($stack));

        Assert::equals('foo', array_pop($stack));
        Assert::equals(0, count($stack));
    }
}

Features

  • Run test cases in separated processes (up to 10 processes per suite);
  • Lazy loading test cases to memory. Loads only tests with which we work and frees memory when test case is done;
  • Flexible configuration: you are able to change global settings and settings for each suite;
  • Multiple dependencies;
  • Any methods may be used before and after case or test;
  • Test case have two types of data storages:
    • local (access only from tests in same case);
    • global (shared storage for all cases in single process);
  • Project are uses composer and based on PSR-0 standart, uses Symfony components and very simple to extend;
  • Register your own listeners, use Unteist events and generate custom reports.

What next

  • Store you configuration in different formats (yml, xml, json or all together);
  • A lot of new kind of class and methods filters (like namespace filter, mask filter);
  • Code Coverage Analysis.

License

Creative Commons License
Unteist by Andrey Kolchenko is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/komex/unteist.

统计信息

  • 总下载量: 1.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 2

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-SA-3.0
  • 更新时间: 2013-08-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固