Skip to content

Commit

Permalink
fix(tmpl.test): as per new metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 25, 2018
1 parent 213bbeb commit dc07912
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions resources/tests/test.twig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{'<?php'}}

namespace {{testFqns}};
namespace {{testNamespace}};

use {{classFqcn}};
use {{phpunit}} as TestCase;

{% set special = isTrait or isAbstract or isInterface %}
{% if special %}
/**
* Wraps {{className}}
* Wraps {{className}}.
*/
{% endif %}
{% if isTrait %}
Expand All @@ -31,7 +31,7 @@ class Test{{className}} extends {{className}}

{% endif %}
/**
* Auto generated by `phint test`
* Auto generated by `phint test`.
*/
class {{className}}Test extends TestCase
{
Expand Down Expand Up @@ -59,27 +59,27 @@ class {{className}}Test extends TestCase
parent::tearDown();
}
{% endif %}
{% for method, attr in methods if not attr.abstract %}
{% for name, method in methods if method.isPublic and not method.isAbstract and not method.maybeMagic %}

{% if naming == 't' %}
public function test{{method|ucfirst}}()
public function test{{name|ucfirst}}()
{% elseif naming == 'm' %}
public function test_{{method|snake}}()
public function test_{{name|snake}}()
{% elseif naming == 'i' %}
/**
* @test
*/
public function it_{{method}}()
public function it_{{name}}()
{% endif %}
{
{% if attr.static %}
$actual = {{className}}::{{method}}();
{% if method.isStatic %}
$actual = {{className}}::{{name}}();
{% elseif setup %}
$actual = $this->{{className|lcfirst}}->{{method}}();
$actual = $this->{{className|lcfirst}}->{{name}}();
{% else %}
${{className|lcfirst}} = new {{ special ? 'Test' : ''}}{{className}};

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

// $this->assertSame('', $actual);
Expand Down

0 comments on commit dc07912

Please sign in to comment.