Commit 32beed5c authored by Lukas Haemmerle's avatar Lukas Haemmerle

Integrated contribution from Geoffroy Arnoud (RENATER), which adds support for...

Integrated contribution from Geoffroy Arnoud (RENATER), which adds support for sorting accented values. See merge request aai/SWITCHwayf!8
parents 8c20009f af942389
This diff is collapsed.
<?php
use PHPUnit\Framework\TestCase;
require("../lib//functions.php");
final class SortTest extends TestCase
{
public function testRemoveAccents()
{
$string = "Foo";
$this->assertEquals(
removeAccents($string),
"Foo"
);
$string = "Fôö";
$this->assertEquals(
removeAccents($string),
"Foo"
);
$this->assertLessThan(
0,
strcasecmp(removeAccents("École"), removeAccents("Foo"))
);
}
public function testSortAccents()
{
$first{"Name"} = "Bar";
$last{"Name"} = "Foo";
$this->assertLessThan(
0,
sortUsingTypeIndexAndName($first, $last)
);
$first{"Name"} = "École";
$last{"Name"} = "Foo";
$this->assertLessThan(
0,
sortUsingTypeIndexAndName($first, $last)
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment