mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Chill\PersonBundle\Tests\Controller;
|
||||
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class PersonDuplicateControllerViewTest extends WebTestCase
|
||||
{
|
||||
public function setUp()
|
||||
@@ -15,18 +26,18 @@ class PersonDuplicateControllerViewTest extends WebTestCase
|
||||
->get('doctrine.orm.entity_manager');
|
||||
|
||||
$center = $this->em->getRepository('ChillMainBundle:Center')
|
||||
->findOneBy(array('name' => 'Center A'));
|
||||
->findOneBy(['name' => 'Center A']);
|
||||
|
||||
$this->person = (new Person())
|
||||
->setLastName("Tested Persan")
|
||||
->setFirstName("Réginal")
|
||||
->setLastName('Tested Persan')
|
||||
->setFirstName('Réginal')
|
||||
->setCenter($center)
|
||||
->setGender(Person::MALE_GENDER);
|
||||
$this->em->persist($this->person);
|
||||
|
||||
$this->person2 = (new Person())
|
||||
->setLastName("Tested Person")
|
||||
->setFirstName("Réginald")
|
||||
->setLastName('Tested Person')
|
||||
->setFirstName('Réginald')
|
||||
->setCenter($center)
|
||||
->setGender(Person::MALE_GENDER);
|
||||
$this->em->persist($this->person2);
|
||||
@@ -36,12 +47,12 @@ class PersonDuplicateControllerViewTest extends WebTestCase
|
||||
|
||||
public function testViewDuplicatePerson()
|
||||
{
|
||||
$client = static::createClient(array(), array(
|
||||
$client = static::createClient([], [
|
||||
'PHP_AUTH_USER' => 'center a_social',
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
));
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
]);
|
||||
|
||||
$crawler = $client->request('GET', '/en/person/'.$this->person->getId().'/duplicate/view');
|
||||
$crawler = $client->request('GET', '/en/person/' . $this->person->getId() . '/duplicate/view');
|
||||
$response = $client->getResponse();
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
|
||||
@@ -49,15 +60,15 @@ class PersonDuplicateControllerViewTest extends WebTestCase
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("Réginal")')->count());
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("Réginald")')->count());
|
||||
|
||||
$crawler = $client->request('GET', '/en/person/'.$this->person->getId().'/duplicate/'.$this->person2->getId().'/confirm');
|
||||
$crawler = $client->request('GET', '/en/person/' . $this->person->getId() . '/duplicate/' . $this->person2->getId() . '/confirm');
|
||||
$response = $client->getResponse();
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("Old person")')->count());
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("New person")')->count());
|
||||
|
||||
$crawler = $client->request('POST', '/en/person/'.$this->person->getId().'/duplicate/'.$this->person2->getId().'/confirm', [
|
||||
'chill_personbundle_person_confirm_duplicate[confirm]' => 1
|
||||
$crawler = $client->request('POST', '/en/person/' . $this->person->getId() . '/duplicate/' . $this->person2->getId() . '/confirm', [
|
||||
'chill_personbundle_person_confirm_duplicate[confirm]' => 1,
|
||||
]);
|
||||
$response = $client->getResponse();
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
|
Reference in New Issue
Block a user