Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 15 20:09

    dg on master

    tested on PHP 8 Dumper: store files when output… (compare)

  • Oct 15 19:48

    dg on master

    Dumper: store files when output… (compare)

  • Oct 15 17:45

    dg on master

    tested on PHP 8 (compare)

  • Oct 15 17:12

    dg on master

    fixed compatibility with PHP 8 tested on PHP 8 (compare)

  • Oct 15 15:34

    dg on master

    fixed compatibility with PHP 8 tested on PHP 8 (compare)

  • Oct 15 15:20

    dg on master

    tested on PHP 8 (compare)

  • Oct 15 15:17

    dg on master

    CliTester: removed .php from he… marked @internal members FileMutator: $context is requir… and 3 more (compare)

  • Sep 29 09:42
    jiripudil commented #393
  • Sep 17 11:10
    dg commented #422
  • Sep 15 13:31

    dg on master

    FileMutator: Make sure to resto… (compare)

  • Sep 09 14:03
    milo commented #393
  • Sep 09 08:48
    f3l1x commented #393
  • Sep 09 08:35
    jiripudil commented #393
  • Sep 09 08:31
    jiripudil synchronize #393
  • Sep 08 10:59
    jiripudil synchronize #393
  • Sep 07 21:55
    mesour edited #422
  • Sep 07 21:54
    mesour edited #422
  • Sep 07 21:53
    mesour edited #422
  • Sep 07 21:52
    mesour opened #422
  • Aug 24 21:45

    dg on master

    FileMutator: $context is requir… (compare)

Miloslav Hůla
@milo
@Darracq Probably. This is pseudo code only.
Martin Zlámal
@mrtnzlml
Hi @jiripudil. What does "Tester plugin requires Nette Tester with TeamCity output format support (1.7.1 found)" mean (PhpStorm plugin)? Is that correct: https://github.com/jiripudil/intellij-nette-tester/blob/master/src/cz/jiripudil/intellij/nette/tester/NetteTesterFramework.java#L25 ?
Miloslav Hůla
@milo
@mrtnzlml It means that you need @jiripudil's Tester fork. The TeamCity output format is not part of Nette Tester for now.
Martin Zlámal
@mrtnzlml
@milo Oh, didn't know that. Thanks...
Martin Štekl
@stekycz
Is it possible to merge this nette/tester#293 since I would like to use it in one project? Or do you have some comments? I would like to hear about it so I could argue or fix it. Thanks!
Jan Tolg
@hantc
Is possible to watch two directories with --watch in nette tester?
Miloslav Hůla
@milo
@hantc Yes. You can use it multiple times.
Jan Tolg
@hantc
@milo what do u mean multiple times? I tried to pass 2 arguments (= 2 directories) after --watch parameter but that didn't work
Miloslav Hůla
@milo
@hantc --watch dir --watch dir
Jan Tolg
@hantc
@milo moc diky, funguje
Roman Mátyus
@romanmatyus
Hello, I have defined secret Environment variable in Travis CI (testing API keys). It's possible read it in Nette\Tester test?
Miloslav Hůla
@milo
@romanmatyus If it is ordinary system environment var, than yes. Tester does not drop env vars, only adds some own.
Roman Mátyus
@romanmatyus
@milo Vyriešil som to primitívne - v before_script som zavolal printf "eurosms:\n\tid: $EUROSMSID\n\tkey: $EUROSMSKEY\n" > tests/secret.neon
@milo V testoch následne stačilo prečítať hodnoty z neon-u. :) Viz. https://github.com/romanmatyus/SMSender/blob/master/.travis.yml
Miloslav Hůla
@milo
@romanmatyus :+1:
Jan Tolg
@hantc
Potrebuji napsat test na jednom silenym systemu a test mi padne na tomto: E_DEPRECATED: Function eregi() is deprecated - je mozne nejak tester umlcet? kdybych deprecated veci typu eregi mel na projektu upravovat, tak bych to delal 3 mesice fulltime.
Miloslav Hůla
@milo
@hantc There are many ways. You can use shut-up (@) operator for specific lines in tests. Or setup own error handler after Environment::setup() call and ignore speficic errors. Or change severity by error_reporting()after Environment::setup() call.
Pavel Ptacek
@foglcz
Ahojte! Nevite nekdo nahodou jaky je status nette 2.4? dev-master je aktualne broken, RC branche mi hazi Nette\DI\ContainerLoader::load: order of arguments has been swapped. a dle komentu @fprochazka soudim ze @dg dela nejaky refactor v masteru aby se to dostalo jeste do 2.4?
David Grudl
@dg
@foglcz it should work. But this is english Tester forum :-)
Pavel Ptacek
@foglcz
@dg lol, my mistake, sorry! :D
Přemysl Karbula
@smuuf
Hi guys, quick question: is there some flag for tester to display standard output (echos, dumps, etc.) while testing? Or what the workflow should be when one's developing tests? I find it rather nasty to run single .phpt files solo when creating tests, which is the only way I found for output to be really outputted - so that I can know what's really what. Surely there must be some other way to do this. The docs were unhelpful in this topic. How would you do this? Thank you :)
David Matějka
@matej21
@smuuf running single .phpt is not nasty, I use it all the time :)
Přemysl Karbula
@smuuf
well, but it IS quite nasty :D .. having to copy the php -c /etc/php5/cli thing and then add whatever complicated path of the single test file in directory structure which can be pretty long. So are you saying this is normal? :)
pytest has this: py.test -s (http://pytest.org/latest/capture.html) ... And I'm just wondering if Tester has anyting similar :)
Miloslav Hůla
@milo
@smuuf There is no easy way for now. Stdout is not passed when test pass. Hack is Assert::fail('STOP') on the test end. You will see stdout then.
To CLI: create an alias runTest=vendor/bin/tester -c php.ini -foo -bar and call runTest tests/my.phpt
But the most convinient way is run test from IDE>
Přemysl Karbula
@smuuf
Maybe I'll look for a SublimeText test helper plugin later.
For now an alias seems like a pretty good idea, although I might create some nice bash script for it instead. Thanks :)
jakubvojacek
@jakubvojacek

Hello, I am trying to use Nette\Tester for running tests. My tests are within one class with testCase annotation. They all are using database but the idea is that all tests should run on clean database (that I recreate before running tests). Therefore I have added start transaction and rollback queries to setUp() and tearDown() methods. It's all working splendidly until I run into a deadlock.

Is there a way for me to catch Deadlock exceptions (for example \Dibi\DriverException with code 1213) and in case this error is encountered, the whole test (just the one test* method) will start again?

Or what other approach could I use to achieve the same? I wouldn't want to re-create the database before each single test as that would be very time consuming and this transaction & rollback is working just like I need - except for the deadlock issue.

Thank you!

jakubvojacek
@jakubvojacek
Solved it via forking the tester project and adding one more try & catch into TestCase class - in case anyone would be searching for the same - https://github.com/nette/tester/compare/master...jakubvojacek:49d9af115282ec4e5f1afdb5fb3dae0c9da4c38f?diff=unified&expand=1&name=49d9af115282ec4e5f1afdb5fb3dae0c9da4c38f
Miloslav Hůla
@milo
@jakubvojacek You can use Environment::lock() method to keep run tests in sequence https://tester.nette.org/#toc-lock
jakubvojacek
@jakubvojacek
Thank you, that does look exactly like what I need, must have overlooked it while reading doc. Will try to use that, it's cleaner then my solution definetly
Jan Brabec
@brabijan
Hello, is there any way to continue on failure, when i'm using dataProvider as annotation in test case? I want to see every failed result in output, not just the first one.
cc @milo @matej21
Miloslav Hůla
@milo
It is not :-( Maybe somehow hack the Assert::onFailure.
jakubvojacek
@jakubvojacek
Hello, it's possible to run just one test from testCase? Im having like 20 tests and they take some time to process and of them is failing - can I somehow just run that one test?
Miloslav Hůla
@milo
@jakubvojacek Run it from where? From test itself? $testcase->run('testMethod') or from command line? php test.phpt --method=testMethod
jakubvojacek
@jakubvojacek

from command line like this php vendor/nette/tester/src/tester.php -p php -c tests/php.ini tests/CategoryTest.phpt

Exception: Unknown option --method.

Miloslav Hůla
@milo
The tester.php is a Test runner. It runs always whole TestCase, cannot specify method. But every test can run as ordinary PHP script, without runner. So you can run php -c tests/php.ini tests/CategoryTest.phpt --method=testMethod.
jakubvojacek
@jakubvojacek
perfect, this works just like I needed. thank you!
Miloslav Hůla
@milo
You are welcome.
Jan Buchar
@Teyras
Hi, I use Tester with php-coveralls and there is a weird bug where I get a 100% coverage on completely uncovered files. Does anybody have an idea whose error it is?
It looks like Tester doesn't generate any <line> elements for completely uncovered files... Is that OK?
Miloslav Hůla
@milo
@Teyras According to the clover.xsd from Clover for Ant (https://www.atlassian.com/software/clover/download), yes, there can be zero <line> elements. IMHO, the important are the attributes loc (lines of code) and ncloc` (non-covered LOC) on <metrics>.
But I never found some official Clover specification web page. This is the best I found.
Jan Buchar
@Teyras
@milo OK, thanks a lot! These look OK in the generated XML, so I should probably go bug the php-coveralls guy :)
David "Fires" Stein
@Fires04
Hi, are there some command line parameter to make tester more verbose ? I want something like test.phpt
case1 -- pass, case2 -- pass , case3 -- fail
Milan Macháček
@Machacek76
Zdar netušíte někdo jak při testu, odeslat data odeslat json data v rawBody?