Skip to content

Commit 957cdc6

Browse files
committed
Improve atoum configuration, autoloader and tests
1 parent 6c0406e commit 957cdc6

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

.atoum.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<?php
22

3-
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
3+
require_once __DIR__ . DIRECTORY_SEPARATOR . 'autoloader.php';
44

55
use
66
mageekguy\atoum\jsonSchema,
77
Atoum\PraspelExtension
88
;
99

10-
1110
$runner
1211
->addExtension(new jsonSchema\extension($script))
1312
->addExtension(new PraspelExtension\Manifest())
1413
;
14+
15+
$script->noCodeCoverageForNamespaces('mageekguy\atoum\asserters');
16+
$script->noCodeCoverageForClasses('mageekguy\atoum\asserter');

.bootstrap.atoum.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
<?php
22

3-
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
3+
if (is_file($vendorAutoloader = __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'))
4+
{
5+
require_once $vendorAutoloader;
6+
}
7+
8+
require_once __DIR__ . DIRECTORY_SEPARATOR . 'autoloader.php';

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ matrix:
1313
- php: hhvm-nightly
1414

1515
notifications:
16-
irc: "irc.freenode.org#jubianchifr"
16+
irc: "irc.freenode.org##atoum"
1717

1818
before_script:
1919
- composer install
2020

2121
script:
2222
- vendor/bin/atoum --test-ext
23-

autoloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
atoum\autoloader::get()
88
->addNamespaceAlias('atoum\jsonSchema', __NAMESPACE__)
99
->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes');
10-
;
10+
;

tests/units/classes/asserters/json.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ public function testSetWithJsonGrammar($json)
4747

4848
protected function testSetWithJsonGrammarDataProvider()
4949
{
50-
return $this->sampleMany($this->realdom->grammar(__DIR__ . '/../../../resources/json.pp'));
50+
$parser = \Hoa\Compiler\Llk\Llk::load(new \Hoa\File\Read(__DIR__ . '/../../../resources/json.pp'));
51+
$visitor = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
52+
$coverage = new \Hoa\Compiler\Llk\Sampler\Coverage($parser, $visitor);
53+
$bound = new \Hoa\Compiler\Llk\Sampler\BoundedExhaustive($parser, $visitor);
54+
55+
return array_merge(
56+
iterator_to_array($coverage),
57+
iterator_to_array($bound)
58+
);
59+
60+
//return $this->sampleMany($this->realdom->grammar(__DIR__ . '/../../../resources/json.pp'));
5161
}
5262

5363
public function testValidates()

0 commit comments

Comments
 (0)