예제 #1
0
파일: NumTest.php 프로젝트: nexeck/docs
	public function testOrdinal()
	{
		$this->assertSame('nd', Num::ordinal(22));
		$this->assertSame('th', Num::ordinal(11));
		$this->assertSame('st', Num::ordinal(21));
		$this->assertSame('rd', Num::ordinal(73));
		$this->assertSame('th', Num::ordinal(100000));

		$spot = 3;
		$this->assertSame('I got 3rd place in the tournament', sprintf('I got %d%s place in the tournament', $spot, Num::ordinal($spot)));

		$number = 3;
		$this->assertSame('3rd', $number.Num::ordinal($number));
	}
예제 #2
0
 /**
  *
  * @test
  * @dataProvider provider_ordinal
  * @param integer $number
  * @param <type> $expected
  */
 public function test_ordinal($number, $expected)
 {
     $this->assertSame($expected, Num::ordinal($number));
 }