Skip to content

Commit dbf1e7c

Browse files
Switched to codeception for unit tests
1 parent 8ff8c1d commit dbf1e7c

13 files changed

Lines changed: 610 additions & 267 deletions

File tree

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
6-
- 7.2
7-
- 7.3
84
- 7.4
95
- 8.0
6+
- 8.1
107

118
before_script:
129
- 'composer install --dev --prefer-source'
1310

14-
script: php test/test.php
11+
script: vendor/bin/codecept run

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
A simple parser to split SQL (and/or DDL) files into individual SQL queries and strip comments.
44

5-
[![PHP Version](https://img.shields.io/badge/php-7.0%2B-blue.svg)](https://packagist.org/packages/kodus/sql-split)
5+
[![PHP Version](https://img.shields.io/badge/php-7.4%2B-blue.svg)](https://packagist.org/packages/kodus/sql-split)
66
[![PHP Version](https://img.shields.io/badge/php-8.0%2B-blue.svg)](https://packagist.org/packages/kodus/sql-split)
7-
[![Build Status](https://travis-ci.com/kodus/sql-split.svg?branch=master)](https://travis-ci.com/kodus/sql-split)
7+
[![PHP Version](https://img.shields.io/badge/php-8.1%2B-blue.svg)](https://packagist.org/packages/kodus/sql-split)
8+
[![Build Status](https://travis-ci.org/kodus/sql-split.svg?branch=master)](https://travis-ci.org/kodus/sql-split)
89

910
### Install via Composer
1011

codeception.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
paths:
2+
tests: tests
3+
output: tests/_output
4+
data: tests/_data
5+
support: tests/_support
6+
envs: tests/_envs
7+
actor_suffix: Tester
8+
extensions:
9+
enabled:
10+
- Codeception\Extension\RunFailed

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
88
"name": "Rasmus Schultz",
99
"email": "rasmus@mindplay.dk"
1010
},
11-
{
11+
{
1212
"name": "Thomas Nordahl Pedersen",
1313
"email": "thno@jfmedier.dk"
14-
}
14+
}
1515
],
1616
"require": {
17-
"php": "^7.0|^8.0"
18-
},
19-
"require-dev": {
20-
"mindplay/testies": "^0.3.0"
17+
"php": ">=7.4"
2118
},
2219
"autoload": {
2320
"psr-4": {
2421
"Kodus\\SQL\\": "src/"
2522
}
23+
},
24+
"require-dev": {
25+
"codeception/codeception": "^4.2",
26+
"codeception/module-asserts": "^2.0"
2627
}
2728
}

test/test.php

Lines changed: 0 additions & 254 deletions
This file was deleted.

tests/_data/.gitkeep

Whitespace-only changes.

tests/_output/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

tests/_support/Helper/Unit.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
namespace Helper;
3+
4+
// here you can define custom actions
5+
// all public methods declared in helper class will be available in $I
6+
7+
class Unit extends \Codeception\Module
8+
{
9+
10+
}

tests/_support/UnitTester.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method void pause()
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class UnitTester extends \Codeception\Actor
20+
{
21+
use _generated\UnitTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)