Download the PHP package bakgul/laravel-tests-to-readme without Composer

On this page you can find all versions of the php package bakgul/laravel-tests-to-readme. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-tests-to-readme

Laravel Tests To Readme

This package aims to generate readme files while tests are being executed. To make this work, you need to call it inside a test method. So, it won't convert each and every test methods to readme file automatically.

Installation and Configuration

Now, you can go and change the settings after publishing config file, which is 'to-readme.php'

Finally, we need a folder to store readme files. You can name it as you wish, but it has to be located under one of the folder of the test class path. For example, if your test class is in

then you can create a folder in

base_path() or base_path('tests') or base_path('tests/Feature') etc.

Some Notes

  1. I suggest you keep readme folder on the root level. That being said, each file will be named based on the testing class. So, if you have multiple classes with the same name, you can't use base_path('readme') for all of them. In that case, you may want to create multiple readme folders.
  2. This package doesn't produce final README.md file. You need to create it manually.
  3. When you add a new test with a call to this package, your new method will be added to the target file.
  4. You can modify the output because it won't be overwritten once it's being printed out.
  5. When you rename a test method, it will be added to the target file. But you need to delete the old one manually.
  6. You can add paragraph, lists, tables in between code blocks. They will be preserved.

How It Works

You should call this package in your test method.

The code above will generate a readme/MyClass.md file and put the content like between the horizontal lines down below.


MyClass

doSomething


As you may have noticed, we passed a value as result, and it's printed in the code block. I suggest you do this way, but you don't have to specify the outcome of the method. When the key of "result" doesn't exist, we will try to execute the method and produce the outcome to print.

Phpdoc vs Typehint

This package can use both to produce file. If you make merge_phpdoc_and_method_declaration => true, we will move types from phpdoc to typehint. Otherwise, we won't change anything.

The method down below

will be printed like this:

When you use both, and there is an inconsistency between phpdoc and typehints, a warning message will be printed. The method down below

will be printed like this:

There are other inconsistency checks, too. You can find them in to-readme.php

Some Limitations

  1. As it's mentioned before, when you don't pass 'result,' we will try to call the method and get the output. If the class has dependencies, it will probably won't work. In such cases, you better specify the result manually.
  2. The array returned by the method will be converted to Json string and then modifyed through some character replacements to make it looks like a PHP array. It might not turn out well in all cases.
  3. Identifier heading levels cannot be used anywhere else in readme.
  4. First line that starts with '//' has to be the name of the test method.
  5. I couldn't find any way to print out the callable arguments. So, you need to add them manually.

License

This is open-sourced software licensed under the MIT license.


All versions of laravel-tests-to-readme with dependencies

PHP Build Version
Package Version
Requires bakgul/laravel-helpers Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bakgul/laravel-tests-to-readme contains the following files

Loading the files please wait ....