Skip to content

Commit

Permalink
add phpunit and phpcs
Browse files Browse the repository at this point in the history
Signed-off-by: Crisciany Silva <crisciany.souza@librecode.coop>
  • Loading branch information
Any97Cris committed Feb 20, 2024
1 parent 7445ae9 commit 7ce5fef
Show file tree
Hide file tree
Showing 9 changed files with 1,877 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
vendor
/vendor-bin/**/vendor/
19 changes: 18 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,22 @@
}
],
"minimum-stability": "dev",
"require": {}
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8"
},
"scripts": {
"cs:check": "phpcs --standard=PSR12 -n src -n tests",
"cs:fix": "phpcbf --standard=PSR12 -n src -n tests",
"test:unit": "phpunit"
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"extra":{
"bamarni-bin":{
"forward-command":true
}
}
}
76 changes: 76 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/Espeak.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Libresign\Espeak;

class Espeak{

public function getVersion(){
\exec('espeak-ng --version', $output);
preg_match('/: (?<version>[\d\.]+) /',$output[0], $matches);
return $matches['version'];
}

}
16 changes: 16 additions & 0 deletions tests/Unit/EspeakTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Libresign\Espeak\Espeak;
use PHPUnit\Framework\TestCase;

class EspeakTest extends TestCase {

public function testGetVersion(){
$Espeak = new Espeak();
$actual = $Espeak->getVersion();
$this->assertNotEmpty($actual);
}



}
5 changes: 5 additions & 0 deletions vendor-bin/coding-standard/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"squizlabs/php_codesniffer": "^3.9"
}
}
99 changes: 99 additions & 0 deletions vendor-bin/coding-standard/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor-bin/phpunit/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"phpunit/phpunit": "^11.0"
}
}
Loading

0 comments on commit 7ce5fef

Please sign in to comment.