Skip to content

Commit

Permalink
fix(tmpl.test): test stubs template
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 23, 2018
1 parent a518bb9 commit 0725a9e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions resources/tests/test.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Test{{className}} extends {{className}}
*/
class {{className}}Test extends TestCase
{
{% if newable or special %}
{% if (newable or special) and setup %}
/**
* @var {{ special ? 'Test' : ''}}{{className}}
*/
Expand All @@ -62,7 +62,7 @@ class {{className}}Test extends TestCase
{% for method, attr in methods if not attr.abstract %}

{% if naming == 't' %}
public function test{{method|capitalize}}()
public function test{{method|ucfirst}}()
{% elseif naming == 'm' %}
public function test_{{method|snake}}()
{% elseif naming == 'i' %}
Expand All @@ -73,12 +73,16 @@ class {{className}}Test extends TestCase
{% endif %}
{
{% if attr.static %}
{{className}}::{{method}}();
$actual = {{className}}::{{method}}();
{% elseif setup %}
$actual = $this->{{className|lcfirst}}->{{method}}();
{% else %}
$this->{{className|lcfirst}}->{{method}}();
${{className|lcfirst}} = new {{ special ? 'Test' : ''}}{{className}};

$actual = ${{className|lcfirst}}->{{method}}();
{% endif %}

// $this->assert
// $this->assertSame('', $actual);
}
{% endfor %}
}

0 comments on commit 0725a9e

Please sign in to comment.