Skip to content

Commit

Permalink
add first test case for new module
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jun 18, 2016
1 parent 38a6e35 commit f45bfef
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create()
->in('bin')
->in('src')
->in('tests');
$config = Symfony\CS\Config\Config::create();
$config->level(null);
$config->fixers(
array(
'braces',
'duplicate_semicolon',
'elseif',
'empty_return',
'encoding',
'eof_ending',
'function_call_space',
'function_declaration',
'indentation',
'join_function',
'line_after_namespace',
'linefeed',
'lowercase_keywords',
'parenthesis',
'multiple_use',
'method_argument_space',
'object_operator',
'php_closing_tag',
'remove_lines_between_uses',
'short_array_syntax',
'short_tag',
'standardize_not_equal',
'trailing_spaces',
'unused_use',
'visibility',
'whitespacy_lines',
)
);
$config->finder($finder);
return $config;
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
},
"autoload": {
"psr-4": {
"HumusAmqpModule\\": "src/HumusAmqpModule/"
"HumusAmqpModule\\": "src/",
"HumusAmqpModuleTest\\": "tests/"

}
}
},
"bin": [
"bin/humus-amqp"
]
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
syntaxCheck="true"
>
<testsuite name="HumusAmqpModule Test-Suite">
<directory>./tests/HumusAmqpModuleTest</directory>
<directory>./tests</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions tests/Container/CliFactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* Copyright (c) 2016. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/

declare (strict_types=1);

namespace HumusAmqpModuleTest\Container;

use HumusAmqpModule\Container\CliFactory;
use Interop\Container\ContainerInterface;
use PHPUnit_Framework_TestCase as TestCase;
use Symfony\Component\Console\Application;

/**
* Class CliFactoryTest
* @package HumusAmqpModuleTest\Container
*/
class CliFactoryTest extends TestCase
{
/**
* @test
*/
public function it_creates_console_runner()
{
$container = $this->prophesize(ContainerInterface::class);

$factory = new CliFactory();
$runner = $factory($container->reveal());

$this->assertInstanceOf(Application::class, $runner);
}
}

0 comments on commit f45bfef

Please sign in to comment.