tester icon indicating copy to clipboard operation
tester copied to clipboard

Extract storeAssertDiff from Dumper::dumpException

Open trejjam opened this issue 8 years ago • 6 comments

  • bug fix? no
  • new feature? yes
  • BC break? no

This refactor Dumper::dumpException in the way that part maintaining storing Assert diff is callable from other test libraries.

trejjam avatar Jan 02 '18 12:01 trejjam

Hi @milo, are there any opinions on this?

trejjam avatar May 30 '18 13:05 trejjam

I'll check it during next week.

milo avatar May 31 '18 16:05 milo

Btw what the purpose is?

milo avatar May 31 '18 17:05 milo

I use it with mango tester to store a diff.

trejjam avatar May 31 '18 17:05 trejjam

Thanks for rebase!

Your storeAssertDiff() does two things. Translates exception into message and creates dump files (arg reference is not nice public API). Do you need both?

I know mango flavoured Tester, but not its source code in detail. Could you elaborate more in detail why do you need extract this functionality? From your description it looks like you only need to remove @internal from saveOutput() method.

milo avatar Jun 13 '18 08:06 milo

The storing part is what I would like to port into Mango tester.

It uses own TestCase, where the only message about assert fault is reported, not simple fault then require xDebug or the other inspection method.

What about removing @internal or simplifying PR to move only logic in https://github.com/nette/tester/blob/master/src/Framework/Dumper.php#L264 and make it publicly callable?

You are right that storeAssertDiff API is not good enough.

trejjam avatar Jun 13 '18 08:06 trejjam