cundd / test-flight Goto Github PK
View Code? Open in Web Editor NEWPHP documentation tester
Home Page: https://test-flight.cundd.net
License: MIT License
PHP documentation tester
Home Page: https://test-flight.cundd.net
License: MIT License
PHP-5.6 will still be quiet a long time around. Which features of PHP-7 are you needing?
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 eval
d 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.
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.
This is a very minor issue and also acceptable if it won't be fixed. I had to remove <?php
from my documentation to get test-flight
work.
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.
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.
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.