Commit af942389 authored by Geoffroy ARNOUD's avatar Geoffroy ARNOUD

Added support for sorting even when there are accents #K7

parent 8c20009f
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