I
I
ilysion_in_life2019-07-18 10:19:24
PHP
ilysion_in_life, 2019-07-18 10:19:24

How to create a phpUnit test for such a class?

Good afternoon, please tell me how to create a phpunit test for this class, if not difficult? I'm new to this ( https://pastebin.com/udQQL5hk ) I was tormented for half a night and could not figure out how to build this test correctly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-07-18
@ilysion_in_life

class TestTest {
    public function testGetExact() {
        $str = '*строка для тестирования*';
        $expected = '*посчитанный результат*';
        $this->assertEquals($expected, Test::getExact($str));
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question