Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "json"
ini-values: "memory_limit=-1"
php-version: 7.4
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --no-suggest --ansi
- name: Run tests
run: ./vendor/phpunit/phpunit/phpunit
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: dependencies
dependencies:
composer install
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=5.5.0",
"php": "^7.3",
"symfony/expression-language": "^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4" : {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/TextGenerator/Tag/TagReplacerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public function testSetTags()
$tr = new TagReplacer();
$tr->setTags(['tag1' => 'val1', 'tag2' => 'val2']);
$this->assertEquals(['tag1' => 'val1', 'tag2' => 'val2'], $tr->getTags());
$this->assertEquals(['@tag1' => 'val1', '@tag2' => 'val2'], $tr->getEscapedTags());
$this->assertEquals(['@tag1' => 'val1ERROR', '@tag2' => 'val2'], $tr->getEscapedTags());
}

public function testSetTagsWithArrayTag()
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/ChooseFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ChooseFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new ChooseFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/CoalesceFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class CoalesceFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new CoalesceFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/ExprFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ExprFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new ExprFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/FilterFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class FilterFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new FilterFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/IfFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class IfFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new IfFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/LoopFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class LoopFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new LoopFunction($this->tagReplacer);
$this->oneElementTag = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ProbabilityRandomFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new ProbabilityRandomFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/RandomFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class RandomFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new RandomFunction($this->tagReplacer);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/SetFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class SetFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->textGenerator = new TextGenerator();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/TextGenerator/TextFunction/ShuffleFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ShuffleFunctionTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->tagReplacer = new TagReplacer();
$this->function = new ShuffleFunction($this->tagReplacer);
}
Expand Down
4 changes: 1 addition & 3 deletions tests/TextGenerator/TextGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

namespace Neveldo\TextGenerator;

echo "hihihihih";

class TextGeneratorTest extends \PHPUnit\Framework\TestCase
{
public function setUp() {
public function setup(): void {
$this->textGenerator = new TextGenerator();
}

Expand Down