Giter VIP home page Giter VIP logo

test-flight's Introduction

test-flight's People

Contributors

cundd avatar t2l avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

test-flight's Issues

Add custom bootstrap code for examples

Consider adding a custom bootstrap code (similar to phpunit's --bootstrap option) which would allow defining needed resources in the scope of the test (e.g. files, variables, class imports).

To emphasize on a single aspect, the documentation might show just an excerpt of runnable code (e.g. variable definitions are missing). The bootstrap script would then define those missing variables and imports. Here's a real world documentation example:

$throttle->setRate(100, BandwidthThrottle::KIBIBYTES);

The bootstrap script would need to provide $throttle and use bandwidthThrottle\BandwidthThrottle.
That means the bootstrap code needs to be evald together with the example code as one string.

I guess a next problem would arise how to refer to specific examples in the bootstrap code, as one might setup different scenarios for different examples. I suggest not including the bootstrap in the documentation itself, because the purpose of documentation is being readable for the user in the first place.

Support Tests on class level

It seems that @example on class level is ignored:

/**
 * @example assert (true);
 */
class Foo
{
}

Tests: 0 | Assertions: 0 | Successful: 0 | Failures: 0

Sorry for spaming so many issues. But I am really excited about your tool.

Support <code> in PHPDoc

Reading the current documentation of @example, I'm not sure if this tag is the best place for inline code:

A location to a file MUST be specified.

I have the impression that inline code is better supported by a <code> block. This is the output of apigen for a class level comment with <code>. I suggest to support <code> as well.

Edit: After hitting #7 I double checked this issue on method level, and <code> is not supported there as well.

Support setting classloader

Ok, I'm using my patched version from #3 in a PHP-5.6 setting, but I guess this is a general issue. How is test-flight supposed to know about the classloader? I would expect some commandline option to point test-flight to my class loader. E.g. something like this:

test-flight --classloader vendor/autoload.php README.md

In this case I would even expect that test-flight might check that very common location per default. Currently I fail to test my documentation because test-flight doesn't find the classes (use in the documentation). But again, this could be related to my patch.

Release

Could you please tag a release?

$ composer.phar require cundd/test-flight
Could not find package cundd/test-flight at any version for your minimum-stability (stable)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.