PHP code example of desarrolla2 / test-bundle

1. Go to this page and download the library: Download desarrolla2/test-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

desarrolla2 / test-bundle example snippets

 php
class ActivityTest extends WebTestCase
{
    public function testIndex()
    {
        $client = $this->getClient();
        $user = $this->logIn($client, '[email protected]', $this->getBackendRoles());

        $this->requestAndAssertOkAndHtml(
            $client,
            'GET',
            '_app.activity.index'
        );
    }        
}
 php
class ProfileTest extends WebTestCase
{
    public function testChangePassword()
    {
        $client = $this->getClient();
        $user = $this->logIn($client, '[email protected]', $this->getBackendRoles());

        $this->requestGetAndPostAndAssertRedirect(
            $client,
            '_app.profile.password',
            [],
            'form',
            ['password' => ['first' => 'changeM3', 'second' => 'changeM3']]
        );
    }        
}
txt
╰─$ cat var/logs/desarrolla2.routes.pending.txt
01. GET  _app.report.billing.payment
02. POST _app.transport.locator.view
03. GET  _app_admin_billing_invoice_batch
04. GET  _app_admin_contact_batch
05. GET  _app_admin_file_file_list
06. GET  _app_admin_participant_batch
07. GET  _public.contract.back
08. GET  _public.file.download
09. GET  _public.proposal.view
10. GET  _student.default.switch
[...]