/usr/share/php/tests/Horde_Support/Horde/Support/Numerizer/Locale/BaseTest.php is in php-horde-support 2.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | <?php
/**
* @category Horde
* @package Support
* @subpackage UnitTests
*/
/**
* @category Horde
* @package Support
* @subpackage UnitTests
*/
class Horde_Support_Numerizer_Locale_BaseTest extends PHPUnit_Framework_TestCase
{
public function testStraightParsing()
{
$numerizer = Horde_Support_Numerizer::factory();
$strings = array(
1 => 'one',
5 => 'five',
10 => 'ten',
11 => 'eleven',
12 => 'twelve',
13 => 'thirteen',
14 => 'fourteen',
15 => 'fifteen',
16 => 'sixteen',
17 => 'seventeen',
18 => 'eighteen',
19 => 'nineteen',
20 => 'twenty',
27 => 'twenty seven',
31 => 'thirty-one',
59 => 'fifty nine',
100 => 'a hundred',
100 => 'one hundred',
150 => 'one hundred and fifty',
// 150 => 'one fifty',
200 => 'two-hundred',
500 => '5 hundred',
999 => 'nine hundred and ninety nine',
1000 => 'one thousand',
1200 => 'twelve hundred',
1200 => 'one thousand two hundred',
17000 => 'seventeen thousand',
21473 => 'twentyone-thousand-four-hundred-and-seventy-three',
74002 => 'seventy four thousand and two',
99999 => 'ninety nine thousand nine hundred ninety nine',
100000 => '100 thousand',
250000 => 'two hundred fifty thousand',
1000000 => 'one million',
1250007 => 'one million two hundred fifty thousand and seven',
1000000000 => 'one billion',
1000000001 => 'one billion and one',
);
foreach ($strings as $key => $string) {
$this->assertEquals($key, (int)$numerizer->numerize($string));
}
}
public function testMissspelledForty()
{
$numerizer = Horde_Support_Numerizer::factory();
$this->assertEquals(40, $numerizer->numerize('forty'));
$this->assertEquals(40, $numerizer->numerize('fourty'));
}
public function testLeavesDatesAlone()
{
$numerizer = Horde_Support_Numerizer::factory();
$this->assertEquals('2006-08-20 03:00', $numerizer->numerize('2006-08-20 03:00'));
$this->assertEquals('2006-08-20 15:30:30', $numerizer->numerize('2006-08-20 15:30:30'));
}
public function testStaticNumerize()
{
$this->assertEquals('2006-08-20 03:00', Horde_Support_Numerizer::numerize('2006-08-20 03:00'));
}
}
|