Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Commit

Permalink
Add file headers + Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-thebaud committed Feb 15, 2018
1 parent 82eea49 commit d839793
Show file tree
Hide file tree
Showing 122 changed files with 1,102 additions and 9 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
[![Total Downloads][ico-downloads]][link-downloads]

PhpUnitGen is an open source development tool which will help you writing your unit tests for PHPUnit 6 / 7:
* Generate unit skeleton for all PHP files.
* Generate unit skeleton for all PHP files including classes, traits, interfaces and global functions.
* Automatically generate a few simple unit tests (like getter / setter methods tests, class instantiation).

__Version 2 of PhpUnitGen is now available, but be careful, it breaks the PhpUnitGen 1.x.x API.__

## Package structure

```
Expand All @@ -34,30 +36,30 @@ $ composer require --dev paulthebaud/phpunit-generator ^2.0

`--dev` option is used to install this package only in development environment.

## Basic usage
## Basic usages

A detailed documentation is available [here](DOCUMENTATION.md), but here is a simple description of usages.

PhpUnitGen basic usage is from command line with the following command.
PhpUnitGen basic usage is from command line with the following command. Use this command in project root directory.

```bash
$ php ./vendor/bin/phpunitgen
```

__Note__: All across your generated tests skeletons, you will find `@todo` PHP annotations to complete them.
__Note__: All across your generated tests skeletons, you will find `@todo` PHP annotations to complete your unit tests.

For this command, you will need a configuration file written in `Yaml`, `Json` or `Php`.

* `Yaml` example is available [here](examples/phpunitgen.config.yml).
* `Json` example is available [here](examples/phpunitgen.config.json).
* `Php` example is available [here](examples/phpunitgen.config.php).

By default, PhpUnitGen search for a configuration file named `./phpunitgen.yml`.
By default, PhpUnitGen search for a configuration file named `phpunitgen.yml` at the project root.

But if you want to use a custom configuration path, you can use an option:

```bash
$ php ./vendor/bin/phpunitgen --config=my/custom/config.json
$ php ./vendor/bin/phpunitgen --config=my/custom/config.yml
```

Use PhpUnitGen on one file only:
Expand All @@ -72,16 +74,18 @@ Use PhpUnitGen on one directory only:
$ php ./vendor/bin/phpunitgen --dir source/dir target/dir
```

Use PhpUnitGen with default configuration:
Use PhpUnitGen with default configuration on a file or on a directory:

```bash
$ php ./vendor/bin/phpunitgen --default --file source/file.php target/file.php
$ php ./vendor/bin/phpunitgen --default --dir source/dir target/dir
```

PhpUnitGen can also be used online on [this website](https://phpunitgen.heroku.com)
__Note__: When parsing a directory, PhpUnitGen will also parse sub-directories.

PhpUnitGen can also be used online on [this website](https://phpunitgen.io)

## Testing
## Running tests

```bash
$ composer test
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AbstractAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AnnotationFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AnnotationInterface/AnnotationInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation\AnnotationInterface;

use PhpUnitGen\Exception\AnnotationParseException;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AnnotationLexer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use Doctrine\Common\Lexer\AbstractLexer;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AnnotationParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Exception\AnnotationParseException;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AnnotationRegister.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/AssertAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/ConstructAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/GetAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/MockAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/ParamsAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/SetAnnotation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Annotation/TokenConsumer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Annotation;

use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/AbstractConsoleConfigFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Configuration\ConfigurationInterface\ConsoleConfigInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/BaseConfig.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Configuration\ConfigurationInterface\ConfigInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/ConfigurationInterface/ConfigInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration\ConfigurationInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration\ConfigurationInterface;

/**
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/ConsoleConfig.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Configuration\ConfigurationInterface\ConsoleConfigInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/DefaultConsoleConfigFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Configuration\ConfigurationInterface\ConsoleConfigInterface;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/JsonConsoleConfigFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Exception\InvalidConfigException;
Expand Down
9 changes: 9 additions & 0 deletions src/Configuration/PhpConsoleConfigFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of PHPUnit Generator.
*
* (c) 2017-2018 Paul Thébaud <paul.thebaud29@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace PhpUnitGen\Configuration;

use PhpUnitGen\Exception\InvalidConfigException;
Expand Down

0 comments on commit d839793

Please sign in to comment.