Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vjik/demo-codeception-db-populator

Database Populator for Codeception DB Module demo project
https://github.com/vjik/demo-codeception-db-populator

Last synced: about 5 hours ago
JSON representation

Database Populator for Codeception DB Module demo project

Awesome Lists containing this project

README

        

# [Database Populator for Codeception DB Module](https://github.com/vjik/codeception-db-populator) Demo Project

[![Build status](https://github.com/vjik/codeception-db-populator/workflows/build/badge.svg)](https://github.com/vjik/codeception-db-populator/actions?query=workflow%3Abuild)
[![Powered by Yii3](https://img.shields.io/badge/Powered_by-Yii3-green.svg?style=flat)](https://www.yiiframework.com/yii3-progress)
[![License](https://poser.pugx.org/vjik/codeception-db-populator/license)](/LICENSE)

Minimal console application based on Yii3 for demonstration work with [Database Populator for Codeception](https://github.com/vjik/codeception-db-populator).

## Requirements

- PHP 8.0 or higher.
- MySQL databasee.

MySQL configuration:

- host: `127.0.0.1`
- name: `dbpopulator`
- user: `root`
- password: `root`

> Note: you can change MySQL configuration in `./.env` file that contain environment variables.

## Applying migrations

```shell
./yii migrate/up
```

## Console commands

Author:

- `./yii author/create `
- `./yii author/delete `

Category:

- `./yii category/create `
- `./yii category/delete `

Post:

- `./yii post/create [-a|--author ] [-c|--category ]`
- `./yii post/delete `

## Creating dumps for tests

Windows:

```shell
./tests/make-dumps.bat
```

## Testing

Require MySQL database with configuration:

- host: `127.0.0.1`
- name: `dbpopulator_test`
- user: `root`
- password: `root`

Require environment variable `APP_ENV` with value `test`.

To run tests:

```shell
./vendor/bin/codecept run
```

> Note: in Windows you can run script `./tests/run.bat` that sets environment variable `APP_ENV` and run codeception.

## License

The Codeception Database Populator Demo Project is free software. It is released under the terms of the BSD License. Please see [`LICENSE`](./LICENSE.md) for more information.