Skip to content
Draft
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
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Main

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Test (using kahlan)
run: ./vendor/bin/kahlan
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/vendor/
/coverage.json
/composer.phar
.idea
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
],
"autoload": {
"psr-4": {
"Eno\\": ["src", "src/elements/", "src/errors/"],
"Eno\\Errors\\": "src/errors",
"Eno\\Reporters\\": "src/reporters"
"Eno\\": "src"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion spec/elements/empty.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{EmptyElement, Section};
use Eno\{Elements\EmptyElement, Elements\Section};

describe('EmptyElement', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/elements/field.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Field, Parser, Section};
use Eno\{Elements\Field, Parser, Elements\Section};

describe('Field', function() {
beforeAll(function() {
Expand Down
8 changes: 4 additions & 4 deletions spec/elements/fieldset.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Field, Fieldset, Parser, Section};
use Eno\{Elements\Field, Elements\Fieldset, Parser, Elements\Section};

describe('Fieldset', function() {
beforeAll(function() {
Expand Down Expand Up @@ -59,7 +59,7 @@
});

it('returns an element', function() {
expect($this->result)->toBeAnInstanceOf('Eno\\Field');
expect($this->result)->toBeAnInstanceOf('Eno\\Elements\\Field');
});

it('returns the right element', function() {
Expand Down Expand Up @@ -168,7 +168,7 @@
describe("with [ 'element' => true ]", function() {
it('returns the element', function() {
$this->result = $this->fieldset->entry('eno', [ 'element' => true ]);
expect($this->result)->toBeAnInstanceOf('Eno\\Field');
expect($this->result)->toBeAnInstanceOf('Eno\\Elements\\Field');
});
});

Expand All @@ -179,7 +179,7 @@
});

it('returns the element', function() {
expect($this->result['element'])->toBeAnInstanceOf('Eno\\Field');
expect($this->result['element'])->toBeAnInstanceOf('Eno\\Elements\\Field');
});

it('returns the value', function() {
Expand Down
10 changes: 5 additions & 5 deletions spec/elements/lazy_construction.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Field, Fieldset, ListElement, Parser};
use Eno\{Elements\Field, Elements\Fieldset, Elements\ListElement, Parser};

describe('Fetching an empty element through fieldset()', function() {
beforeEach(function() {
Expand All @@ -9,7 +9,7 @@
});

it('returns a fieldset', function() {
expect($this->fieldset)->toBeAnInstanceOf('Eno\\Fieldset');
expect($this->fieldset)->toBeAnInstanceOf('Eno\\Elements\\Fieldset');
});

it('returns a fieldset with enforceAllElements disabled', function() {
Expand Down Expand Up @@ -37,7 +37,7 @@
});

it('returns a fieldset as first element', function() {
expect($this->fieldsets[0])->toBeAnInstanceOf('Eno\\Fieldset');
expect($this->fieldsets[0])->toBeAnInstanceOf('Eno\\Elements\\Fieldset');
});

it('returns a fieldset with enforceAllElements disabled', function() {
Expand All @@ -63,7 +63,7 @@
});

it('returns a field as first element', function() {
expect($this->fields[0])->toBeAnInstanceOf('Eno\\Field');
expect($this->fields[0])->toBeAnInstanceOf('Eno\\Elements\\Field');
});
});

Expand All @@ -76,6 +76,6 @@
});

it('returns a list as first element', function() {
expect($this->lists[0])->toBeAnInstanceOf('Eno\\ListElement');
expect($this->lists[0])->toBeAnInstanceOf('Eno\\Elements\\ListElement');
});
});
4 changes: 2 additions & 2 deletions spec/elements/list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Field, ListElement, Section};
use Eno\{Elements\Field, Elements\ListElement, Elements\Section};

describe('List', function() {
beforeAll(function() {
Expand Down Expand Up @@ -110,7 +110,7 @@

it('returns the elements', function() {
foreach($this->result as $item) {
expect($item['element'])->toBeAnInstanceOf('Eno\\Field');
expect($item['element'])->toBeAnInstanceOf('Eno\\Elements\\Field');
}
});

Expand Down
4 changes: 2 additions & 2 deletions spec/elements/section.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Field, Section};
use Eno\{Elements\Field, Elements\Section};

describe('Section', function() {
beforeAll(function() {
Expand Down Expand Up @@ -77,7 +77,7 @@

it('returns the elements of the section', function() {
foreach($this->result as $element) {
expect($element)->toBeAnInstanceOf('Eno\\Field');
expect($element)->toBeAnInstanceOf('Eno\\Elements\\Field');
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::duplicateFieldsetEntryName', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/fieldset_entry_in_field.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::fieldsetEntryInField', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/fieldset_entry_in_list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::fieldsetEntryInList', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/list_item_in_field.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::listItemInField', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/list_item_in_fieldset.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::listItemInFieldset', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::missingElementForContinuation', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::missingNameForFieldsetEntry', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/missing_name_for_list_item.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::missingNameForListItem', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/analysis/section_hierarchy_layer_skip.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Analysis::sectionHierarchyLayerSkip', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/error.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\Error;
use Eno\Errors\Error;

describe('Error', function() {
given('text', function() { return 'My error'; });
Expand Down
4 changes: 2 additions & 2 deletions spec/errors/parse_error.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, ParseError};
use Eno\{Errors\Error, Errors\ParseError};

describe('ParseError', function() {
given('text', function() { return 'My error'; });
Expand Down Expand Up @@ -32,7 +32,7 @@
expect($this->error->cursor)->toEqual($this->cursor);
});

it('is generically catchable as an Eno\\Error when thrown', function() {
it('is generically catchable as an Eno\\Errors\\Error when thrown', function() {
$caught = false;

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingBlockIntoFieldset', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_block_into_list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingBlockIntoList', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_block_into_section.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingBlockIntoSection', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldIntoFieldset', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_field_into_list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldIntoList', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_field_into_section.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldIntoSection', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldsetIntoField', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_fieldset_into_list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldsetIntoList', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingFieldsetIntoSection', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_list_into_field.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingListIntoField', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_list_into_fieldset.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingListIntoFieldset', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_list_into_section.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingListIntoSection', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_section_into_empty.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingSectionIntoEmpty', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_section_into_field.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingSectionIntoField', function() {
beforeAll(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingSectionIntoFieldset', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/copying_section_into_list.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::copyingSectionIntoList', function() {
beforeAll(function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/errors/resolution/cyclic_dependency.spec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

use Eno\{Error, Parser};
use Eno\{Errors\Error, Parser};

describe('Resolution::cyclicDependency', function() {
given('scenarios', function() {
Expand Down
Loading