承接 ignaszak/testing-tools 相关项目开发

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

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

ignaszak/testing-tools

Composer 安装命令:

composer require ignaszak/testing-tools

包简介

Testing tools

README 文档

README

This package provides tools for testing class via reflection.

Requirements

  • PHP >= 7.0.0
  • PHPUnit >= 6.0.0

Installation

composer require ignaszak/testing-tools

Usage

Get property value

<?php

use Ignaszak\TestingTools\Test;

Test::get('propertyName', $object);

Set property value

<?php

use Ignaszak\TestingTools\Test;

// Set value
Test::inject('propertyName', 'new value', $object);
// Get value
Test::get('propertyName', $object);

Call method

<?php

use Ignaszak\TestingTools\Test;

// Call method with args
Test::call('method', ['arg1', 'arg2'], $object);
// Call method wthout args
Test::call('method', null, $object);

Define tested class

You can set instance of tested class in Test::$object.

<?php

use Ignaszak\TestingTools\Test;

Test::$object = new Example();

// All these methods refers to `Example`
Test::inject('propertyName', 'new value');
Test::inject('propertyName'); // Set null
Test::get('propertyName');
Test::call('method');
Test::call('method', ['arg1', 'arg2']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固