Skip to content

Commit

Permalink
UT added
Browse files Browse the repository at this point in the history
  • Loading branch information
MortalFlesh committed Jul 30, 2017
1 parent 96e3673 commit cbcb646
Show file tree
Hide file tree
Showing 6 changed files with 566 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/vendor/
composer.lock

/code-coverage

.php_cs.cache
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"phpunit": "vendor/bin/phpunit -c phpunit.xml.dist",
"phpstan": "vendor/bin/phpstan analyse -l 5 -c phpstan.neon src tests",
"fix": [
"./bin/php-cs-fixer fix src",
"./bin/php-cs-fixer fix tests",
"./bin/phpcbf --standard=ruleset.xml ."
"vendor/bin/php-cs-fixer fix src",
"vendor/bin/php-cs-fixer fix tests",
"vendor/bin/phpcbf --standard=ruleset.xml ."
]
}
}
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
parameters:
ignoreErrors:
- '#Doctrine\\ORM\\Query\\Expr#'
- '#Method Mockery\\MockInterface::shouldReceive\(\) invoked with 1 parameter, 0 required#'
2 changes: 0 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
const MODIFIER_APPEND = QBC_NAMESPACE . 'modifierAppend';
const MODIFIER_SET = QBC_NAMESPACE . 'modifierSet';

const EXPLODE_BY_SPACE = QBC_NAMESPACE . 'explodeBySpace';

const APPEND = true;

function compose(array $parts, QueryBuilder $queryBuilder): QueryBuilder
Expand Down
27 changes: 27 additions & 0 deletions tests/Fixture/SelectModifier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace MF\QueryBuilderComposer\Tests\Fixture;

use Doctrine\ORM\QueryBuilder;
use MF\QueryBuilderComposer\Modifier;

class SelectModifier implements Modifier
{
/** @var string */
private $column;

public function __construct(string $column)
{
$this->column = $column;
}

public function __invoke(QueryBuilder $queryBuilder): QueryBuilder
{
return $queryBuilder->select($this->column);
}

public static function addSelectId(QueryBuilder $queryBuilder): QueryBuilder
{
return $queryBuilder->select('s.id');
}
}
Loading

0 comments on commit cbcb646

Please sign in to comment.