Code Monkey home page Code Monkey logo

Comments (7)

milo avatar milo commented on May 20, 2024

How do you run it? I tried the most simple case and nothing happend. Tester takes methods by reflection.

use Tester\Assert;

require __DIR__ . '/bootstrap.php';  # from Tester libs

class Test extends Tester\TestCase {

/*
    public function testSomething() // it will try to run this
    {
        ///
    }
*/

}

$t = new Test;
$t->run();

EDIT: I guess you run it manually by $t->run('testSomething').

from tester.

paranoiq avatar paranoiq commented on May 20, 2024

TestHandler runs it and this is the reason: https://github.com/nette/tester/blob/master/Tester/Runner/TestHandler.php#L145

from tester.

dg avatar dg commented on May 20, 2024

This (and #62) should be solved in initiateTestCase():

  1. by running testcase with special argument that returns list of methods
  2. by parsing file via tokenizer

I think 1) is better solution.

from tester.

milo avatar milo commented on May 20, 2024

Choice 1) seems better, but because of TestCases with constructor, new static method would be better. On the other side, there is a need to find a descendant of TestCase class name. It can be done by regexp, but tokenizer is better. And when the tokenizer is used, it can be used for all.

from tester.

milo avatar milo commented on May 20, 2024

@dg What about 3) option: Set TESTER_LIST_TEST_METHODS environment var, and TestCase::run() prints serialized methods and die.

from tester.

fprochazka avatar fprochazka commented on May 20, 2024

Evironment variable is actually a great idea :)

from tester.

milo avatar milo commented on May 20, 2024

In addition, by expecting an output of TestCase::run() in pre-run phase can be checked that method has been called at all :)

from tester.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.