mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
74 lines
2.3 KiB
PHP
74 lines
2.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\EventBundle\Tests\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
/**
|
|
* @internal
|
|
* @coversNothing
|
|
*/
|
|
final class RoleControllerTest extends WebTestCase
|
|
{
|
|
public function testSkipped()
|
|
{
|
|
$this->markTestSkipped();
|
|
}
|
|
|
|
/*
|
|
public function testCompleteScenario()
|
|
{
|
|
// Create a new client to browse the application
|
|
$client = static::createClient();
|
|
|
|
// Create a new entry in the database
|
|
$crawler = $client->request('GET', '/{_locale}/admin/role/');
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /{_locale}/admin/role/");
|
|
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
|
|
|
|
// Fill in the form and submit it
|
|
$form = $crawler->selectButton('Create')->form(array(
|
|
'chill_eventbundle_role[field_name]' => 'Test',
|
|
// ... other fields to fill
|
|
));
|
|
|
|
$client->submit($form);
|
|
$crawler = $client->followRedirect();
|
|
|
|
// Check data in the show view
|
|
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
|
|
|
|
// Edit the entity
|
|
$crawler = $client->click($crawler->selectLink('Edit')->link());
|
|
|
|
$form = $crawler->selectButton('Update')->form(array(
|
|
'chill_eventbundle_role[field_name]' => 'Foo',
|
|
// ... other fields to fill
|
|
));
|
|
|
|
$client->submit($form);
|
|
$crawler = $client->followRedirect();
|
|
|
|
// Check the element contains an attribute with value equals "Foo"
|
|
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
|
|
|
|
// Delete the entity
|
|
$client->submit($crawler->selectButton('Delete')->form());
|
|
$crawler = $client->followRedirect();
|
|
|
|
// Check the entity has been delete on the list
|
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
|
}
|
|
|
|
*/
|
|
}
|