Sign inSign up

acseo/ai-phpunit

By acseo

•Updated about 2 years ago

AI PHPUnit is a tool that uses GPT-4 to automatically add missing PHPUnit tests to your PHP code.

Image
Developer tools
0

10K+

acseo/ai-phpunit repository overview

AI PHPUnit is a tool that uses GPT-4 to automatically add missing PHPUnit tests to your PHP code.

https://github.com/acseo/ai-phpunit⁠

⁠Prerequisites

This package uses the OpenAI API. Before using AI PHPDocs, you will need to have an OpenAI API key set as an environment variable.

⁠Usage

You can use the Docker image acseo/ai-phpdoc to use ai-phpdoc via docker

To add missing PHPDoc comments to a single file, use the following command:

docker run -it -e OPENAI_KEY=sk-xxx -v /path/to/your/code:/code acseo/ai-phpunit file  /code/path/to/file.php

To add missing PHPUnit tests to a directory of files, use the following command. By default it iterates through the current directory for all files, but does not go into subdirectories:

docker run -it -e OPENAI_KEY=sk-xxx -v /path/to/your/code:/code acseo/ai-phpunit dir /code

You may set the --recursive flag, or -r for short for it to go into subdirectories.

If you pass another variable (regardless of the recursive flag) it will treat it as another directory to sweep through instead of the working directory.

docker run -it -e OPENAI_KEY=sk-xxx -v /path/to/your/code:/code acseo/ai-phpunit dir -r /code/src

⁠License

AI PHPUnit is licensed under the AGPL-3.0 license. See LICENSE for more information.

Tag summary

Content type

Image

Digest

sha256:6309ad731…

Size

181.7 MB

Last updated

about 2 years ago

docker pull acseo/ai-phpunit