update to lumen 7
Some checks failed
abc-api/abcParser/pipeline/head There was a failure building this commit

This commit is contained in:
2020-06-24 11:58:32 -04:00
parent fb619dccbf
commit 1130f9a22f
10 changed files with 1955 additions and 1383 deletions

View File

@@ -12,10 +12,10 @@ settings:
extensions:
enabled:
- Codeception\Extension\RunFailed
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
#modules:
# config:
# Db:
# dsn: ''
# user: ''
# password: ''
# dump: tests/_data/dump.sql

View File

@@ -10,13 +10,13 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"enzyme/collection": "^1.0",
"enzyme/freckle": "^0.3.0",
"enzyme/parrot": "^0.0.2",
"icanboogie/inflector": "^1.4",
"illuminate/database": "^5.6",
"illuminate/pipeline": "^5.6",
"illuminate/database": "^7.0",
"illuminate/pipeline": "^7.0",
"league/pipeline": "^1.0",
"php-deal/framework": "^0.4.1",
"webpatser/laravel-uuid": "~3.0",
@@ -35,7 +35,8 @@
}
},
"require-dev": {
"codeception/codeception": "^2.4",
"codeception/codeception": "^4.1",
"codeception/module-asserts": "^1.2",
"mockery/mockery": "^1.0",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "^3.2"

2697
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,12 +2,13 @@ version: '3'
services:
tests:
image: dkregistry.xai-corp.net:5000/xaicorp/php:7.2-dev
image: dkregistry.xai-corp.net:5000/xaicorp/php:7.3-dev
volumes:
- .:/var/www
- .:/opt/project
command:
entrypoint:
- vendor/bin/codecept
command:
- run
composer:

View File

@@ -2,6 +2,7 @@
namespace XaiCorp\AbcParser\Domain\Core;
use Enzyme\Axiom\Atoms\StringAtom;
use Illuminate\Support\Arr;
use Webpatser\Uuid\Uuid;
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
@@ -81,7 +82,7 @@ class Tune implements EntityInterface
public function getETag()
{
return md5(implode(';', array_flatten([
return md5(implode(';', Arr::flatten([
$this->getTitles(),
$this->getAuthors(),
$this->getComposers(),

View File

@@ -1,4 +1,4 @@
<?php //[STAMP] d8caeee7956924d9e7b2dc1aaf1abb70
<?php //[STAMP] 726870d9005580da95a5354e36f9cfc0
namespace _generated;
// This class was automatically generated by build task
@@ -18,29 +18,87 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are equal. If you're comparing floating-point values,
* you can specify the optional "delta" parameter which dictates how great of a precision
* error are you willing to tolerate in order to consider the two values equal.
* Handles and checks exception called inside callback function.
* Either exception class name or exception instance should be provided.
*
* Regular example:
* ```php
* <?php
* $I->assertEquals(5, $element->getChildrenCount());
* ```
* $I->expectException(MyException::class, function() {
* $this->doSomethingBad();
* });
*
* Floating-point example:
* $I->expectException(new MyException(), function() {
* $this->doSomethingBad();
* });
* ```
* If you want to check message or exception code, you can pass them with exception instance:
* ```php
* <?php
* $I->assertEquals(0.3, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
* // will check that exception MyException is thrown with "Don't do bad things" message
* $I->expectException(new MyException("Don't do bad things"), function() {
* $this->doSomethingBad();
* });
* ```
*
* @param $exception string or \Exception
* @param $callback
* @deprecated Use expectThrowable() instead
* @see \Codeception\Module\Asserts::expectException()
*/
public function expectException($exception, $callback)
{
return $this->getScenario()->runStep(new Action('expectException', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Handles and checks throwables (Exceptions/Errors) called inside the callback function.
* Either throwable class name or throwable instance should be provided.
*
* ```php
* <?php
* $I->expectThrowable(MyThrowable::class, function() {
* $this->doSomethingBad();
* });
*
* $I->expectThrowable(new MyException(), function() {
* $this->doSomethingBad();
* });
* ```
* If you want to check message or throwable code, you can pass them with throwable instance:
* ```php
* <?php
* // will check that throwable MyError is thrown with "Don't do bad things" message
* $I->expectThrowable(new MyError("Don't do bad things"), function() {
* $this->doSomethingBad();
* });
* ```
*
* @param $throwable string or \Throwable
* @param $callback
* @see \Codeception\Module\Asserts::expectThrowable()
*/
public function expectThrowable($throwable, $callback)
{
return $this->getScenario()->runStep(new Action('expectThrowable', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are equal.
*
* @param $expected
* @param $actual
* @param string $message
* @param float $delta
* @see \Codeception\Module\Asserts::assertEquals()
*/
public function assertEquals($expected, $actual, $message = null, $delta = null) {
public function assertEquals($expected, $actual, $message = null, $delta = null)
{
return $this->getScenario()->runStep(new Action('assertEquals', func_get_args()));
}
@@ -48,21 +106,7 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are not equal. If you're comparing floating-point values,
* you can specify the optional "delta" parameter which dictates how great of a precision
* error are you willing to tolerate in order to consider the two values not equal.
*
* Regular example:
* ```php
* <?php
* $I->assertNotEquals(0, $element->getChildrenCount());
* ```
*
* Floating-point example:
* ```php
* <?php
* $I->assertNotEquals(0.4, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
* ```
* Checks that two variables are not equal
*
* @param $expected
* @param $actual
@@ -205,11 +249,29 @@ trait UnitTesterActions
* @param string $message
* @see \Codeception\Module\Asserts::assertRegExp()
*/
public function assertRegExp($pattern, $string, $message = null) {
public function assertRegExp($pattern, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertRegExp', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that string match with pattern
*
* Alias of assertRegExp
* @param string $pattern
* @param string $string
* @param string $message
* @see \Codeception\Module\Asserts::assertMatchesRegularExpression()
*/
public function assertMatchesRegularExpression($pattern, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertMatchesRegularExpression', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -220,11 +282,29 @@ trait UnitTesterActions
* @param string $message
* @see \Codeception\Module\Asserts::assertNotRegExp()
*/
public function assertNotRegExp($pattern, $string, $message = null) {
public function assertNotRegExp($pattern, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertNotRegExp', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that string not match with pattern
*
* Alias of assertNotRegExp
* @param string $pattern
* @param string $string
* @param string $message
* @see \Codeception\Module\Asserts::assertDoesNotMatchRegularExpression()
*/
public function assertDoesNotMatchRegularExpression($pattern, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertDoesNotMatchRegularExpression', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -394,11 +474,28 @@ trait UnitTesterActions
* @param string $message
* @see \Codeception\Module\Asserts::assertFileNotExists()
*/
public function assertFileNotExists($filename, $message = null) {
public function assertFileNotExists($filename, $message = null)
{
return $this->getScenario()->runStep(new Action('assertFileNotExists', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file doesn't exist
*
* Alias of assertFileNotExists
* @param string $filename
* @param string $message
* @see \Codeception\Module\Asserts::assertFileDoesNotExist()
*/
public function assertFileDoesNotExist($filename, $message = null)
{
return $this->getScenario()->runStep(new Action('assertFileDoesNotExist', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -407,7 +504,8 @@ trait UnitTesterActions
* @param $description
* @see \Codeception\Module\Asserts::assertGreaterOrEquals()
*/
public function assertGreaterOrEquals($expected, $actual, $description = null) {
public function assertGreaterOrEquals($expected, $actual, $description = null)
{
return $this->getScenario()->runStep(new Action('assertGreaterOrEquals', func_get_args()));
}
@@ -463,22 +561,6 @@ trait UnitTesterActions
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that array contains subset.
*
* @param array $subset
* @param array $array
* @param bool $strict
* @param string $message
* @see \Codeception\Module\Asserts::assertArraySubset()
*/
public function assertArraySubset($subset, $array, $strict = null, $message = null) {
return $this->getScenario()->runStep(new Action('assertArraySubset', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -539,7 +621,8 @@ trait UnitTesterActions
* @param $message
* @see \Codeception\Module\Asserts::fail()
*/
public function fail($message) {
public function fail($message)
{
return $this->getScenario()->runStep(new Action('fail', func_get_args()));
}
@@ -547,72 +630,384 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Handles and checks exception called inside callback function.
* Either exception class name or exception instance should be provided.
*
* ```php
* <?php
* $I->expectException(MyException::class, function() {
* $this->doSomethingBad();
* });
*
* $I->expectException(new MyException(), function() {
* $this->doSomethingBad();
* });
* ```
* If you want to check message or exception code, you can pass them with exception instance:
* ```php
* <?php
* // will check that exception MyException is thrown with "Don't do bad things" message
* $I->expectException(new MyException("Don't do bad things"), function() {
* $this->doSomethingBad();
* });
* ```
*
* @param $exception string or \Exception
* @param $callback
*
* @deprecated Use expectThrowable instead
* @see \Codeception\Module\Asserts::expectException()
* @see \Codeception\Module\Asserts::assertStringContainsString()
*/
public function expectException($exception, $callback)
public function assertStringContainsString($needle, $haystack, $message = null)
{
return $this->getScenario()->runStep(new Action('expectException', func_get_args()));
return $this->getScenario()->runStep(new Action('assertStringContainsString', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Handles and checks throwables (Exceptions/Errors) called inside the callback function.
* Either throwable class name or throwable instance should be provided.
*
* ```php
* <?php
* $I->expectThrowable(MyThrowable::class, function() {
* $this->doSomethingBad();
* });
*
* $I->expectThrowable(new MyException(), function() {
* $this->doSomethingBad();
* });
* ```
* If you want to check message or throwable code, you can pass them with throwable instance:
* ```php
* <?php
* // will check that throwable MyError is thrown with "Don't do bad things" message
* $I->expectThrowable(new MyError("Don't do bad things"), function() {
* $this->doSomethingBad();
* });
* ```
*
* @param $throwable string or \Throwable
* @param $callback
* @see \Codeception\Module\Asserts::expectThrowable()
* @see \Codeception\Module\Asserts::assertStringNotContainsString()
*/
public function expectThrowable($throwable, $callback)
public function assertStringNotContainsString($needle, $haystack, $message = null)
{
return $this->getScenario()->runStep(new Action('expectThrowable', func_get_args()));
return $this->getScenario()->runStep(new Action('assertStringNotContainsString', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertStringContainsStringIgnoringCase()
*/
public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = null)
{
return $this->getScenario()->runStep(new Action('assertStringContainsStringIgnoringCase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertStringNotContainsStringIgnoringCase()
*/
public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = null)
{
return $this->getScenario()->runStep(new Action('assertStringNotContainsStringIgnoringCase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* @since 1.1.0 of module-asserts
* @see \Codeception\Module\Asserts::assertStringEndsWith()
*/
public function assertStringEndsWith($suffix, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertStringEndsWith', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* @since 1.1.0 of module-asserts
* @see \Codeception\Module\Asserts::assertStringEndsNotWith()
*/
public function assertStringEndsNotWith($suffix, $string, $message = null)
{
return $this->getScenario()->runStep(new Action('assertStringEndsNotWith', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsArray()
*/
public function assertIsArray($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsArray', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsBool()
*/
public function assertIsBool($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsBool', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsFloat()
*/
public function assertIsFloat($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsFloat', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsInt()
*/
public function assertIsInt($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsInt', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNumeric()
*/
public function assertIsNumeric($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNumeric', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsObject()
*/
public function assertIsObject($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsObject', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsResource()
*/
public function assertIsResource($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsResource', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsString()
*/
public function assertIsString($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsString', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsScalar()
*/
public function assertIsScalar($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsScalar', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsCallable()
*/
public function assertIsCallable($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsCallable', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotArray()
*/
public function assertIsNotArray($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotArray', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotBool()
*/
public function assertIsNotBool($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotBool', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotFloat()
*/
public function assertIsNotFloat($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotFloat', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotInt()
*/
public function assertIsNotInt($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotInt', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotNumeric()
*/
public function assertIsNotNumeric($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotNumeric', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotObject()
*/
public function assertIsNotObject($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotObject', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotResource()
*/
public function assertIsNotResource($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotResource', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotString()
*/
public function assertIsNotString($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotString', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotScalar()
*/
public function assertIsNotScalar($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotScalar', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertIsNotCallable()
*/
public function assertIsNotCallable($actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertIsNotCallable', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertEqualsCanonicalizing()
*/
public function assertEqualsCanonicalizing($expected, $actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertEqualsCanonicalizing', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertNotEqualsCanonicalizing()
*/
public function assertNotEqualsCanonicalizing($expected, $actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertNotEqualsCanonicalizing', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertEqualsIgnoringCase()
*/
public function assertEqualsIgnoringCase($expected, $actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertEqualsIgnoringCase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertNotEqualsIgnoringCase()
*/
public function assertNotEqualsIgnoringCase($expected, $actual, $message = null)
{
return $this->getScenario()->runStep(new Action('assertNotEqualsIgnoringCase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertEqualsWithDelta()
*/
public function assertEqualsWithDelta($expected, $actual, $delta, $message = null)
{
return $this->getScenario()->runStep(new Action('assertEqualsWithDelta', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\Asserts::assertNotEqualsWithDelta()
*/
public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = null)
{
return $this->getScenario()->runStep(new Action('assertNotEqualsWithDelta', func_get_args()));
}

View File

@@ -9,6 +9,7 @@
namespace Tests\Unit\AbcParser\Domain\Atoms;
use Enzyme\Axiom\Atoms\AtomInterface;
use Enzyme\Axiom\Exceptions\AtomException;
use PHPUnit_Framework_TestCase;
use XaiCorp\AbcParser\Domain\Atoms\UnsignedIntegerAtom;
@@ -24,24 +25,20 @@ class UnsignedIntegerAtomTest extends PHPUnit_Framework_TestCase
$this->assertEquals($value, $result->getValue());
}
/**
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
*/
public function testCreateAtom0Fails()
{
$value = 0;
$this->expectException(AtomException::class);
$result = new UnsignedIntegerAtom($value);
$this->assertEquals(false, $result, 'should have failed to create');
}
/**
* @expectedException \Enzyme\Axiom\Exceptions\AtomException
*/
public function testCreateNegativeAtomFails()
{
$value = -1;
$this->expectException(AtomException::class);
$result = new UnsignedIntegerAtom($value);

View File

@@ -61,7 +61,7 @@ class TuneTest extends PHPUnit_Framework_TestCase
$result = $tune->getIndex();
$this->assertInternalType('integer', $result);
$this->assertIsInt($result);
$this->assertEquals(1, $result);
}

View File

@@ -34,7 +34,7 @@ class ContextTest extends PHPUnit_Framework_TestCase
$this->assertGreaterThan(1, count($context));
foreach ($context as $key => $line) {
$this->assertInternalType('string', $line);
$this->assertIsString($line);
}
}

View File

@@ -26,7 +26,7 @@ class DefaultInterpreterTest extends PHPUnit_Framework_TestCase
*/
protected $interpreter;
protected function setUp()
protected function setUp(): void
{
$builder = new Builder();
$this->interpreter = new DefaultInterpreter($builder);