@@ -42,41 +42,33 @@ function test_get_data_locPearPath()
42
42
);
43
43
}
44
44
45
- /**
46
- * @expectedException Text_LanguageDetect_Exception
47
- * @expectedExceptionMessage Language database does not exist:
48
- */
49
45
function test_readdbNonexistingFile ()
50
46
{
47
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
48
+ $ this ->expectExceptionMessage ('Language database does not exist: ' );
51
49
$ this ->xproxy ->_readdb ('thisfiledoesnotexist ' );
52
50
}
53
51
54
- /**
55
- * @expectedException Text_LanguageDetect_Exception
56
- * @expectedExceptionMessage Language database is not readable:
57
- */
58
52
function test_readdbUnreadableFile ()
59
53
{
54
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
55
+ $ this ->expectExceptionMessage ('Language database is not readable: ' );
60
56
$ name = tempnam (sys_get_temp_dir (), 'unittest-Text_LanguageDetect- ' );
61
57
chmod ($ name , 0000 );
62
58
$ this ->xproxy ->_readdb ($ name );
63
59
}
64
60
65
- /**
66
- * @expectedException Text_LanguageDetect_Exception
67
- * @expectedExceptionMessage Language database has no elements.
68
- */
69
61
function test_checkTrigramEmpty ()
70
62
{
63
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
64
+ $ this ->expectExceptionMessage ('Language database has no elements. ' );
71
65
$ this ->xproxy ->_checkTrigram (array ());
72
66
}
73
67
74
- /**
75
- * @expectedException Text_LanguageDetect_Exception
76
- * @expectedExceptionMessage Language database is not an array
77
- */
78
68
function test_checkTrigramNoArray ()
79
69
{
70
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
71
+ $ this ->expectExceptionMessage ('Language database is not an array ' );
80
72
$ this ->xproxy ->_checkTrigram ('foo ' );
81
73
}
82
74
@@ -1401,12 +1393,10 @@ function testLanguageExistsArrayNameMode2()
1401
1393
$ this ->assertFalse ($ this ->x ->languageExists (array ('en ' , 'doesnotexist ' )));
1402
1394
}
1403
1395
1404
- /**
1405
- * @expectedException Text_LanguageDetect_Exception
1406
- * @expectedExceptionMessage Unsupported parameter type passed to languageExists()
1407
- */
1408
1396
function testLanguageExistsUnsupportedType ()
1409
1397
{
1398
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
1399
+ $ this ->expectExceptionMessage ('Unsupported parameter type passed to languageExists() ' );
1410
1400
$ this ->x ->languageExists (1.23 );
1411
1401
}
1412
1402
@@ -1428,7 +1418,7 @@ function testGetLanguagesNameMode2()
1428
1418
function testDetect ()
1429
1419
{
1430
1420
$ scores = $ this ->x ->detect ('Das ist ein kleiner Text für euch alle ' );
1431
- $ this ->assertInternalType ( ' array ' , $ scores );
1421
+ $ this ->assertIsArray ( $ scores );
1432
1422
$ this ->assertGreaterThan (5 , count ($ scores ));
1433
1423
1434
1424
reset ($ scores );
@@ -1459,15 +1449,15 @@ function testDetectNameMode2Limit()
1459
1449
function testDetectSimple ()
1460
1450
{
1461
1451
$ lang = $ this ->x ->detectSimple ('Das ist ein kleiner Text für euch alle ' );
1462
- $ this ->assertInternalType ( ' string ' , $ lang );
1452
+ $ this ->assertIsString ( $ lang );
1463
1453
$ this ->assertEquals ('german ' , $ lang , 'text is german ' );
1464
1454
}
1465
1455
1466
1456
function testDetectSimpleNameMode2 ()
1467
1457
{
1468
1458
$ this ->x ->setNameMode (2 );
1469
1459
$ lang = $ this ->x ->detectSimple ('Das ist ein kleiner Text für euch alle ' );
1470
- $ this ->assertInternalType ( ' string ' , $ lang );
1460
+ $ this ->assertIsString ( $ lang );
1471
1461
$ this ->assertEquals ('de ' , $ lang , 'text is german ' );
1472
1462
}
1473
1463
@@ -1687,21 +1677,17 @@ function test_block_detection()
1687
1677
}
1688
1678
}
1689
1679
1690
- /**
1691
- * @expectedException Text_LanguageDetect_Exception
1692
- * @expectedExceptionMessage Pass a single char only to this method
1693
- */
1694
1680
function testUnicodeBlockNameParamString ()
1695
1681
{
1682
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
1683
+ $ this ->expectExceptionMessage ('Pass a single char only to this method ' );
1696
1684
$ this ->x ->unicodeBlockName ('foo bar baz ' );
1697
1685
}
1698
1686
1699
- /**
1700
- * @expectedException Text_LanguageDetect_Exception
1701
- * @expectedExceptionMessage Input must be of type string or int
1702
- */
1703
1687
function testUnicodeBlockNameUnsupportedParamType ()
1704
1688
{
1689
+ $ this ->expectException ('Text_LanguageDetect_Exception ' );
1690
+ $ this ->expectExceptionMessage ('Input must be of type string or int ' );
1705
1691
$ this ->x ->unicodeBlockName (1.23 );
1706
1692
}
1707
1693
0 commit comments