Questions tagged [Codeception] (119)

3
answers

What literature advise on testing?

Hello. Realized that I don't have a clear, structured understanding of how the tests work, what types of tests are, how they differ (acceptance, functional, unit, etc.). How to spell them. Advise the literature on this topic. Will be a big plus if there are examples, even better, if the examples are to PHPUnit or Codeceptio...
Lisette asked March 31st 20 at 15:16
0
answer

How to log in the methods that are called from tests in Codeception?

All kind time of day! Gash HelloWorld on Yii2. Gash a few custom events. In the method event handlers added logging Yii::info(). If you call trigger() in the controller, then everything works OK: logging in the methods event handlers are working fine. When you call trigger() from a method in the class unit test logging is n...
ian44 asked March 30th 20 at 00:43
0
answer

As indicated in yii2 codeception module for the path to a higher level?

You have the following project structure|-app |-- config |--- test.php |-- Modules |--- MyModule |---- codeception.yml //There are tests for module MyModule |---- tests |-- tests //There are tests for the application |-- codeception.ymlapp/codeception.yml looks like this:actor: Tester include: - modules/* paths: tests: te...
niko.Windl asked March 27th 20 at 13:15
1
answer

How to use PHP in codeception?

Climb looking examples of using codeception I do not understand how to use it in the code, so for example the phantomrequire '/vendor/autoload.php'; $browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs'); $browserObj->setKeepalive(true); $windowObj=$browserObj->getNewWindow(); $windowO...
llewellyn.Raynor asked March 27th 20 at 11:17
1
answer

How to send POST request in codeception with the button?

There is a page with the following button<a href="/user/delete?id=1" data-method="post" id="mybutton"></a> Upon clicking it, the browser sends a request to /user/delete?id=1 using POST method. Then the server performs some actions, and in response, it returns a redirect back to the page with a button (/user) Try...
Josefina_White asked March 25th 20 at 11:18
0
answer

What is the meaning of assert_that in this context?

In standard tests Yii2 saw this testpublic function testFindUserByAccessToken() { expect_that($user = User::findIdentityByAccessToken('100-token')); expect($user->username)->equals('admin'); expect_not(User::findIdentityByAccessToken('non-existing')); } Specifically I am interested in here stringexpect_that($user...
tatum_Will asked March 24th 20 at 13:55
1
answer

Why you need a database to test in Yii2?

Deal with testing in Yii2. Download regular basic pattern, trying to run the tests, getException (Database Exception) 'yii\db\Exception' with message 'SQLSTATE[HY000] [1044] Access denied for user 'yii2'@'%' to database 'yii2_basic_tests"Error happens through the console (codecept run) and web (index-test.php). Apparently a...
lora_Berge asked March 24th 20 at 13:13
0
answer

The test execution time. If you in PHPUnit?

Hello. I remember in JUnit (tests for Java) had the opportunity to write the test "the test passes if the script worked for less than 1 second". I can't find in the documentation is there in PHPUnit (Codeception)?
Darron.Ja asked March 24th 20 at 12:58
1
answer

Why tests are run one at a time, but errors occur in certain tests when you run them together?

Have the Yii2 framework, the structure of the type yii2-advanced, 2 types of tests: unit and functional,and here and there use the fixture. When the tests are run one at a time, no errors when run through codecept run without any additional parameters, spilling errors in some tests. When run with option -vvv, everything goe...
lupe_Rohan23 asked March 23rd 20 at 18:26
0
answer

Why not pass the test for removal?

Unit test. Trying to start testing (Yii2) Made fixturespublic function _fixtures() { return [ 'menu' => [ 'class' => \common\fixtures\MenuFixture::className(), 'dataFile' => codecept_data_dir() . 'menu.php' ] ]; } Filled file menu.php Did a test on the creation ofpublic function testCreateMenuItem() { $model...
laila asked March 20th 20 at 10:29