mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,14 +1,46 @@
|
||||
<?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 Search\Utils;
|
||||
|
||||
use Chill\MainBundle\Search\Utils\ExtractPhonenumberFromPattern;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class ExtractPhonenumberFromPatternTest extends KernelTestCase
|
||||
{
|
||||
public function provideData()
|
||||
{
|
||||
yield ['Diallo', 0, [], 'Diallo', 'no phonenumber'];
|
||||
|
||||
yield ['Diallo 15/06/2021', 0, [], 'Diallo 15/06/2021', 'no phonenumber and a date'];
|
||||
|
||||
yield ['Diallo 0486 123 456', 1, ['+32486123456'], 'Diallo', 'a phonenumber and a name'];
|
||||
|
||||
yield ['Diallo 123 456', 1, ['123456'], 'Diallo', 'a number and a name, without leadiing 0'];
|
||||
|
||||
yield ['123 456', 1, ['123456'], '', 'only phonenumber'];
|
||||
|
||||
yield ['0123 456', 1, ['+32123456'], '', 'only phonenumber with a leading 0'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideData
|
||||
*
|
||||
* @param mixed $subject
|
||||
* @param mixed $expectedCount
|
||||
* @param mixed $expected
|
||||
* @param mixed $filteredSubject
|
||||
* @param mixed $msg
|
||||
*/
|
||||
public function testExtract($subject, $expectedCount, $expected, $filteredSubject, $msg)
|
||||
{
|
||||
@@ -19,15 +51,4 @@ class ExtractPhonenumberFromPatternTest extends KernelTestCase
|
||||
$this->assertEquals($filteredSubject, $result->getFilteredSubject());
|
||||
$this->assertEquals($expected, $result->getFound());
|
||||
}
|
||||
|
||||
public function provideData()
|
||||
{
|
||||
yield ['Diallo', 0, [], 'Diallo', "no phonenumber"];
|
||||
yield ['Diallo 15/06/2021', 0, [], 'Diallo 15/06/2021', "no phonenumber and a date"];
|
||||
yield ['Diallo 0486 123 456', 1, ['+32486123456'], 'Diallo', "a phonenumber and a name"];
|
||||
yield ['Diallo 123 456', 1, ['123456'], 'Diallo', "a number and a name, without leadiing 0"];
|
||||
yield ['123 456', 1, ['123456'], '', "only phonenumber"];
|
||||
yield ['0123 456', 1, ['+32123456'], '', "only phonenumber with a leading 0"];
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user