Skip to content

Commit ce73e77

Browse files
authored
Merge pull request #10 from atoum/ci-deps-compat
Improve compatibility with vendors
2 parents 3c6caef + b3f1515 commit ce73e77

20 files changed

+281
-333
lines changed

.atoum.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

.atoum.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
atoum:
2-
directories:
3-
- ./tests/units/classes
4-
52
reports:
6-
- default
3+
- report.default
74
- report.xunit
85
- report.coverage.clover
96

107
fields:
11-
default:
8+
report.default:
129
- field.logo

.bootstrap.atoum.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ php:
66
- 5.5
77
- 5.6
88
- 7.0
9+
- nightly
910
- hhvm
1011
- hhvm-nightly
1112

1213
matrix:
1314
allow_failures:
15+
- php: nightly
1416
- php: hhvm
1517
- php: hhvm-nightly
1618

@@ -23,4 +25,4 @@ sudo: false
2325

2426
script:
2527
- composer update $COMPOSER_PREFER
26-
- ./vendor/bin/atoum
28+
- ./vendor/bin/atoum --test-ext

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ atoum:
5050
- ./tests/units/classes
5151

5252
fields:
53-
default:
53+
report.default:
5454
- field.logo
5555
- field.logo.result
5656
- field.coverage
5757

5858
reports:
59-
- default
59+
- report.default
6060
- report.coverage.clover
6161
```
6262
@@ -114,13 +114,13 @@ Example:
114114
```yaml
115115
atoum:
116116
reports:
117-
- default
117+
- report.default
118118
- report.coverage.clover
119119
```
120120

121121
Possible values :
122122

123-
#### default
123+
#### report.default
124124

125125
adds atoum's default reporter (when the reports key is defined, atoum's default reporter is no longer used).
126126

@@ -165,10 +165,10 @@ This example adds the logo field to the default report :
165165
```yaml
166166
atoum:
167167
reports:
168-
- default
168+
- report.default
169169
170170
fields:
171-
default:
171+
report.default:
172172
- field.logo
173173
```
174174

autoloader.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

classes/configuration.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class configuration
88
{
9-
public function applyTo(atoum\scripts\runner $script)
10-
{
11-
$container = new atoum\config\container();
12-
$container->build($script);
13-
}
9+
public function applyTo(atoum\scripts\runner $script)
10+
{
11+
$container = new atoum\config\container();
12+
$container->build($script);
13+
}
1414
}

classes/configuration/definition.php

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,47 @@
77

88
class definition implements ConfigurationInterface
99
{
10-
public function getConfigTreeBuilder()
11-
{
12-
$tree = new TreeBuilder();
13-
$root = $tree->root('atoum');
14-
15-
$root
16-
->children()
17-
->booleanNode('loop')
18-
->defaultValue((bool) getenv('ATOUM_LOOP'))
19-
->end()
20-
->booleanNode('debug')
21-
->defaultValue((bool) getenv('ATOUM_DEBUG'))
22-
->end()
23-
->integerNode('verbosity')
24-
->defaultValue((int) getenv('ATOUM_VERBOSITY'))
25-
->end()
26-
27-
->arrayNode('directories')
28-
->prototype('scalar')->end()
29-
->defaultValue(array_filter(explode(',', getenv('ATOUM_DIRECTORIES'))))
30-
->end()
31-
32-
->arrayNode('reports')
33-
->prototype('scalar')->end()
34-
->defaultValue(array_filter(explode(',', getenv('ATOUM_REPORTS'))))
35-
->end()
36-
37-
->arrayNode('fields')
38-
->prototype('array')
39-
->prototype('scalar')->end()
40-
->end()
41-
->end()
42-
43-
->arrayNode('writers')
44-
->prototype('array')
45-
->prototype('scalar')->end()
46-
->end()
47-
->end()
48-
->end()
49-
;
50-
51-
return $tree;
52-
}
10+
public function getConfigTreeBuilder()
11+
{
12+
$tree = new TreeBuilder();
13+
$root = $tree->root('atoum');
14+
15+
$root
16+
->children()
17+
->booleanNode('loop')
18+
->defaultValue((bool) getenv('ATOUM_LOOP'))
19+
->end()
20+
->booleanNode('debug')
21+
->defaultValue((bool) getenv('ATOUM_DEBUG'))
22+
->end()
23+
->integerNode('verbosity')
24+
->defaultValue((int) getenv('ATOUM_VERBOSITY'))
25+
->end()
26+
27+
->arrayNode('directories')
28+
->prototype('scalar')->end()
29+
->defaultValue(array_filter(explode(',', getenv('ATOUM_DIRECTORIES'))))
30+
->end()
31+
32+
->arrayNode('reports')
33+
->prototype('scalar')->end()
34+
->defaultValue(array_filter(explode(',', getenv('ATOUM_REPORTS'))))
35+
->end()
36+
37+
->arrayNode('fields')
38+
->prototype('array')
39+
->prototype('scalar')->end()
40+
->end()
41+
->end()
42+
43+
->arrayNode('writers')
44+
->prototype('array')
45+
->prototype('scalar')->end()
46+
->end()
47+
->end()
48+
->end()
49+
;
50+
51+
return $tree;
52+
}
5353
}

classes/container.php

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,46 @@
44

55
use mageekguy\atoum;
66
use mageekguy\atoum\config;
7-
use mageekguy\atoum\config\container;
87
use Symfony\Component\Config\FileLocator;
98
use Symfony\Component\DependencyInjection\ContainerBuilder;
109
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
1110

1211
class container
1312
{
14-
public function __construct()
15-
{
16-
$this->container = new ContainerBuilder();
17-
}
18-
19-
public function build(atoum\scripts\runner $script)
20-
{
21-
$this->container->registerExtension(new container\extension($script));
22-
$this->container
23-
->addCompilerPass(new config\container\compiler\reports($script))
24-
->addCompilerPass(new config\container\compiler\fields($script))
25-
->addCompilerPass(new config\container\compiler\writers($script))
26-
->addCompilerPass(new config\container\compiler\directories($script))
27-
;
28-
29-
$loader = new YamlFileLoader($this->container, new FileLocator(array(__DIR__ . '/../resources')));
30-
$loader->load('services.yml');
31-
32-
$configFile = getcwd() . DIRECTORY_SEPARATOR . '.atoum.yml';
33-
if (is_file($configFile)) {
34-
$loader = new YamlFileLoader($this->container, new FileLocator());
35-
$loader->load($configFile);
36-
}
37-
38-
$this->container->compile();
39-
}
40-
41-
public function set($id, $service)
42-
{
43-
$this->container->set($id, $service);
44-
45-
return $this;
46-
}
13+
public function __construct()
14+
{
15+
$this->container = new ContainerBuilder();
16+
}
17+
18+
public function build(atoum\scripts\runner $script)
19+
{
20+
21+
$this->container->registerExtension(new container\extension($script));
22+
$this->container
23+
->addCompilerPass(new config\container\compiler\script($script))
24+
->addCompilerPass(new config\container\compiler\reports($script))
25+
->addCompilerPass(new config\container\compiler\fields($script))
26+
->addCompilerPass(new config\container\compiler\writers($script))
27+
->addCompilerPass(new config\container\compiler\directories($script))
28+
;
29+
30+
$loader = new YamlFileLoader($this->container, new FileLocator(array(__DIR__ . '/../resources')));
31+
$loader->load('services.yml');
32+
33+
$configFile = getcwd() . DIRECTORY_SEPARATOR . '.atoum.yml';
34+
if (is_file($configFile)) {
35+
$loader = new YamlFileLoader($this->container, new FileLocator());
36+
$loader->load($configFile);
37+
}
38+
39+
$this->container->compile();
40+
$this->container->get('script');
41+
}
42+
43+
public function set($id, $service)
44+
{
45+
$this->container->set($id, $service);
46+
47+
return $this;
48+
}
4749
}

classes/container/compiler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
abstract class compiler implements CompilerPassInterface
99
{
10-
protected $script;
10+
protected $script;
1111

12-
public function __construct(atoum\scripts\runner $script)
13-
{
14-
$this->script = $script;
15-
}
12+
public function __construct(atoum\scripts\runner $script)
13+
{
14+
$this->script = $script;
15+
}
1616
}

classes/container/compiler/directories.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
class directories extends atoum\config\container\compiler
99
{
10-
public function process(ContainerBuilder $container)
11-
{
12-
if ($container->hasParameter('atoum.directories') === false)
13-
{
14-
return;
15-
}
10+
public function process(ContainerBuilder $container)
11+
{
12+
if ($container->hasParameter('atoum.directories') === false)
13+
{
14+
return;
15+
}
1616

17-
$this->script->addTestsFromDirectories($container->getParameter('atoum.directories'));
18-
}
17+
$this->script->addTestsFromDirectories($container->getParameter('atoum.directories'));
18+
}
1919
}

0 commit comments

Comments
 (0)