Skip to content

Commit 0baa83a

Browse files
committed
Configure phpspec env and more cs fixes
1 parent fa29a2e commit 0baa83a

File tree

6 files changed

+58
-4
lines changed

6 files changed

+58
-4
lines changed

.php_cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ declare(strict_types=1);
1414
use LIN3S\PhpCsFixerConfig\Lin3sConfig;
1515

1616
$config = new Lin3sConfig('Pattern Library Builder', '2017', 'library');
17-
$config->getFinder()->in(__DIR__ . '/src');
17+
$config->getFinder()->in([
18+
__DIR__ . '/src',
19+
__DIR__ . '/tests/Application/app',
20+
__DIR__ . '/tests/Application/bin',
21+
__DIR__ . '/tests/Application/src',
22+
__DIR__ . '/tests/Application/web',
23+
]);
1824

1925
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
2026

.phpspec_cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use LIN3S\PhpCsFixerConfig\Lin3sConfig;
1515

1616
$config = new Lin3sConfig('Pattern Library Builder', '2017', 'library');
1717
$config->getFinder()
18-
->in(__DIR__ . '/spec')
18+
->in(__DIR__ . '/tests/spec')
1919
->name('*Spec.php');
2020

2121
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;

phpspec.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file is part of the Pattern Library Builder library.
2+
#
3+
# Copyright (c) 2017-present LIN3S <[email protected]>
4+
#
5+
# For the full copyright and license information, please view the LICENSE
6+
# file that was distributed with this source code.
7+
8+
suites:
9+
app:
10+
spec_path: tests/
11+
spec_prefix: spec
12+
namespace: LIN3S
13+
src_path: src/

test

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
&lt;div&gt;&lt;span&gt;This is&lt;/span&gt;&lt;span&gt;a test!&lt;/span&gt;&lt;/div&gt;

tests/Application/app/AppKernel.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1818
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
1919
use Symfony\Bundle\TwigBundle\TwigBundle;
20+
use Symfony\Bundle\WebServerBundle\WebServerBundle;
2021
use Symfony\Component\Config\Loader\LoaderInterface;
2122
use Symfony\Component\DependencyInjection\ContainerBuilder;
2223
use Symfony\Component\HttpKernel\Kernel;
2324
use Symfony\Component\Routing\RouteCollectionBuilder;
24-
use Symfony\Bundle\WebServerBundle\WebServerBundle;
2525

2626
/**
2727
* @author Beñat Espiña <[email protected]>
@@ -112,7 +112,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
112112
'form_input_border_color_hover' => '#0099ff',
113113
'form_label_text_color' => '#444',
114114
'icon_fill_color' => '#0099ff',
115-
116115
],
117116
]);
118117
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Pattern Library Builder library.
5+
*
6+
* Copyright (c) 2017-present LIN3S <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace spec\LIN3S\PatternLibraryBuilder\Twig;
15+
16+
use LIN3S\PatternLibraryBuilder\Twig\DindentExtension;
17+
use PhpSpec\ObjectBehavior;
18+
19+
class DindentExtensionSpec extends ObjectBehavior
20+
{
21+
public function it_gets_filters()
22+
{
23+
$this->shouldHaveType(DindentExtension::class);
24+
$this->shouldHaveType(\Twig_Extension::class);
25+
26+
$this->getFilters()->shouldBeArray();
27+
}
28+
29+
public function it_uses_dindent()
30+
{
31+
$this->dindent('<div><span>This is</span><span>a test!</span></div>')->shouldReturn(
32+
'&lt;div&gt;&lt;span&gt;This is&lt;/span&gt;&lt;span&gt;a test!&lt;/span&gt;&lt;/div&gt;'
33+
);
34+
}
35+
}

0 commit comments

Comments
 (0)