Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 1145... Línea 1145...
1145
    }
1145
    }
Línea 1146... Línea 1146...
1146
 
1146
 
1147
    /**
1147
    /**
1148
     * Test instance generation.
1148
     * Test instance generation.
1149
     */
1149
     */
1150
    public function test_instance() {
1150
    public function test_instance(): void {
1151
        $this->assertInstanceOf('core_useragent', core_useragent::instance());
1151
        $this->assertInstanceOf('core_useragent', core_useragent::instance());
1152
        $this->assertInstanceOf('core_useragent', core_useragent::instance(true));
1152
        $this->assertInstanceOf('core_useragent', core_useragent::instance(true));
Línea 1153... Línea 1153...
1153
    }
1153
    }
1154
 
1154
 
1155
    /**
1155
    /**
1156
     * @dataProvider user_agents_providers
1156
     * @dataProvider user_agents_providers
1157
     */
1157
     */
1158
    public function test_useragent_edge($useragent, $tests) {
1158
    public function test_useragent_edge($useragent, $tests): void {
Línea 1159... Línea 1159...
1159
        // Setup the core_useragent instance.
1159
        // Setup the core_useragent instance.
1160
        core_useragent::instance(true, $useragent);
1160
        core_useragent::instance(true, $useragent);
Línea 1184... Línea 1184...
1184
    }
1184
    }
Línea 1185... Línea 1185...
1185
 
1185
 
1186
    /**
1186
    /**
1187
     * @dataProvider user_agents_providers
1187
     * @dataProvider user_agents_providers
1188
     */
1188
     */
1189
    public function test_useragent_ie($useragent, $tests) {
1189
    public function test_useragent_ie($useragent, $tests): void {
1190
        // Setup the core_useragent instance.
1190
        // Setup the core_useragent instance.
Línea 1191... Línea 1191...
1191
        core_useragent::instance(true, $useragent);
1191
        core_useragent::instance(true, $useragent);
1192
 
1192
 
Línea 1234... Línea 1234...
1234
    }
1234
    }
Línea 1235... Línea 1235...
1235
 
1235
 
1236
    /**
1236
    /**
1237
     * @dataProvider user_agents_providers
1237
     * @dataProvider user_agents_providers
1238
     */
1238
     */
1239
    public function test_useragent_msword($useragent, $tests) {
1239
    public function test_useragent_msword($useragent, $tests): void {
1240
        // Setup the core_useragent instance.
1240
        // Setup the core_useragent instance.
Línea 1241... Línea 1241...
1241
        core_useragent::instance(true, $useragent);
1241
        core_useragent::instance(true, $useragent);
1242
 
1242
 
Línea 1249... Línea 1249...
1249
    }
1249
    }
Línea 1250... Línea 1250...
1250
 
1250
 
1251
    /**
1251
    /**
1252
     * @dataProvider user_agents_providers
1252
     * @dataProvider user_agents_providers
1253
     */
1253
     */
1254
    public function test_useragent_supports($useragent, $tests) {
1254
    public function test_useragent_supports($useragent, $tests): void {
1255
        // Setup the core_useragent instance.
1255
        // Setup the core_useragent instance.
Línea 1256... Línea 1256...
1256
        core_useragent::instance(true, $useragent);
1256
        core_useragent::instance(true, $useragent);
1257
 
1257
 
Línea 1275... Línea 1275...
1275
    }
1275
    }
Línea 1276... Línea 1276...
1276
 
1276
 
1277
    /**
1277
    /**
1278
     * @dataProvider user_agents_providers
1278
     * @dataProvider user_agents_providers
1279
     */
1279
     */
1280
    public function test_useragent_webkit($useragent, $tests) {
1280
    public function test_useragent_webkit($useragent, $tests): void {
1281
        // Setup the core_useragent instance.
1281
        // Setup the core_useragent instance.
Línea 1282... Línea 1282...
1282
        core_useragent::instance(true, $useragent);
1282
        core_useragent::instance(true, $useragent);
1283
 
1283
 
Línea 1308... Línea 1308...
1308
    }
1308
    }
Línea 1309... Línea 1309...
1309
 
1309
 
1310
    /**
1310
    /**
1311
     * @dataProvider user_agents_providers
1311
     * @dataProvider user_agents_providers
1312
     */
1312
     */
1313
    public function test_useragent_webkit_android($useragent, $tests) {
1313
    public function test_useragent_webkit_android($useragent, $tests): void {
1314
        // Setup the core_useragent instance.
1314
        // Setup the core_useragent instance.
Línea 1315... Línea 1315...
1315
        core_useragent::instance(true, $useragent);
1315
        core_useragent::instance(true, $useragent);
1316
 
1316
 
Línea 1344... Línea 1344...
1344
    }
1344
    }
Línea 1345... Línea 1345...
1345
 
1345
 
1346
    /**
1346
    /**
1347
     * @dataProvider user_agents_providers
1347
     * @dataProvider user_agents_providers
1348
     */
1348
     */
1349
    public function test_useragent_chrome($useragent, $tests) {
1349
    public function test_useragent_chrome($useragent, $tests): void {
1350
        // Setup the core_useragent instance.
1350
        // Setup the core_useragent instance.
Línea 1351... Línea 1351...
1351
        core_useragent::instance(true, $useragent);
1351
        core_useragent::instance(true, $useragent);
1352
 
1352
 
Línea 1381... Línea 1381...
1381
    }
1381
    }
Línea 1382... Línea 1382...
1382
 
1382
 
1383
    /**
1383
    /**
1384
     * @dataProvider user_agents_providers
1384
     * @dataProvider user_agents_providers
1385
     */
1385
     */
1386
    public function test_useragent_safari($useragent, $tests) {
1386
    public function test_useragent_safari($useragent, $tests): void {
1387
        // Setup the core_useragent instance.
1387
        // Setup the core_useragent instance.
Línea 1388... Línea 1388...
1388
        core_useragent::instance(true, $useragent);
1388
        core_useragent::instance(true, $useragent);
1389
 
1389
 
Línea 1418... Línea 1418...
1418
    }
1418
    }
Línea 1419... Línea 1419...
1419
 
1419
 
1420
    /**
1420
    /**
1421
     * @dataProvider user_agents_providers
1421
     * @dataProvider user_agents_providers
1422
     */
1422
     */
1423
    public function test_useragent_ios_safari($useragent, $tests) {
1423
    public function test_useragent_ios_safari($useragent, $tests): void {
1424
        // Setup the core_useragent instance.
1424
        // Setup the core_useragent instance.
Línea 1425... Línea 1425...
1425
        core_useragent::instance(true, $useragent);
1425
        core_useragent::instance(true, $useragent);
1426
 
1426
 
Línea 1455... Línea 1455...
1455
    }
1455
    }
Línea 1456... Línea 1456...
1456
 
1456
 
1457
    /**
1457
    /**
1458
     * @dataProvider user_agents_providers
1458
     * @dataProvider user_agents_providers
1459
     */
1459
     */
1460
    public function test_useragent_ios($useragent, $tests) {
1460
    public function test_useragent_ios($useragent, $tests): void {
1461
        // Setup the core_useragent instance.
1461
        // Setup the core_useragent instance.
Línea 1462... Línea 1462...
1462
        core_useragent::instance(true, $useragent);
1462
        core_useragent::instance(true, $useragent);
1463
 
1463
 
Línea 1476... Línea 1476...
1476
    }
1476
    }
Línea 1477... Línea 1477...
1477
 
1477
 
1478
    /**
1478
    /**
1479
     * @dataProvider user_agents_providers
1479
     * @dataProvider user_agents_providers
1480
     */
1480
     */
1481
    public function test_useragent_gecko($useragent, $tests) {
1481
    public function test_useragent_gecko($useragent, $tests): void {
1482
        // Setup the core_useragent instance.
1482
        // Setup the core_useragent instance.
Línea 1483... Línea 1483...
1483
        core_useragent::instance(true, $useragent);
1483
        core_useragent::instance(true, $useragent);
1484
 
1484
 
Línea 1520... Línea 1520...
1520
    }
1520
    }
Línea 1521... Línea 1521...
1521
 
1521
 
1522
    /**
1522
    /**
1523
     * @dataProvider user_agents_providers
1523
     * @dataProvider user_agents_providers
1524
     */
1524
     */
1525
    public function test_useragent_firefox($useragent, $tests) {
1525
    public function test_useragent_firefox($useragent, $tests): void {
1526
        // Setup the core_useragent instance.
1526
        // Setup the core_useragent instance.
Línea 1527... Línea 1527...
1527
        core_useragent::instance(true, $useragent);
1527
        core_useragent::instance(true, $useragent);
1528
 
1528
 
Línea 1561... Línea 1561...
1561
    }
1561
    }
Línea 1562... Línea 1562...
1562
 
1562
 
1563
    /**
1563
    /**
1564
     * @dataProvider user_agents_providers
1564
     * @dataProvider user_agents_providers
1565
     */
1565
     */
1566
    public function test_useragent_opera($useragent, $tests) {
1566
    public function test_useragent_opera($useragent, $tests): void {
1567
        // Setup the core_useragent instance.
1567
        // Setup the core_useragent instance.
Línea 1568... Línea 1568...
1568
        core_useragent::instance(true, $useragent);
1568
        core_useragent::instance(true, $useragent);
1569
 
1569
 
Línea 1598... Línea 1598...
1598
    }
1598
    }
Línea 1599... Línea 1599...
1599
 
1599
 
1600
    /**
1600
    /**
1601
     * @dataProvider user_agents_providers
1601
     * @dataProvider user_agents_providers
1602
     */
1602
     */
1603
    public function test_get_device_type($useragent, $tests) {
1603
    public function test_get_device_type($useragent, $tests): void {
1604
        // Setup the core_useragent instance.
1604
        // Setup the core_useragent instance.
Línea 1605... Línea 1605...
1605
        core_useragent::instance(true, $useragent);
1605
        core_useragent::instance(true, $useragent);
1606
 
1606
 
Línea 1614... Línea 1614...
1614
    }
1614
    }
Línea 1615... Línea 1615...
1615
 
1615
 
1616
    /**
1616
    /**
1617
     * @dataProvider user_agents_providers
1617
     * @dataProvider user_agents_providers
1618
     */
1618
     */
1619
    public function test_get_browser_version_classes($useragent, $tests) {
1619
    public function test_get_browser_version_classes($useragent, $tests): void {
1620
        // Setup the core_useragent instance.
1620
        // Setup the core_useragent instance.
Línea 1621... Línea 1621...
1621
        core_useragent::instance(true, $useragent);
1621
        core_useragent::instance(true, $useragent);
1622
 
1622
 
Línea 1628... Línea 1628...
1628
    }
1628
    }
Línea 1629... Línea 1629...
1629
 
1629
 
1630
    /**
1630
    /**
1631
     * @dataProvider user_agents_providers
1631
     * @dataProvider user_agents_providers
1632
     */
1632
     */
1633
    public function test_useragent_web_crawler($useragent, $tests) {
1633
    public function test_useragent_web_crawler($useragent, $tests): void {
1634
        // Setup the core_useragent instance.
1634
        // Setup the core_useragent instance.
Línea 1635... Línea 1635...
1635
        core_useragent::instance(true, $useragent);
1635
        core_useragent::instance(true, $useragent);
1636
 
1636
 
1637
        $expectation = isset($tests['is_web_crawler']) ? $tests['is_web_crawler'] : false;
1637
        $expectation = isset($tests['is_web_crawler']) ? $tests['is_web_crawler'] : false;
Línea 1638... Línea 1638...
1638
        $this->assertSame($expectation, core_useragent::is_web_crawler());
1638
        $this->assertSame($expectation, core_useragent::is_web_crawler());
1639
    }
1639
    }
1640
 
1640
 
1641
    /**
1641
    /**
1642
     * @dataProvider user_agents_providers
1642
     * @dataProvider user_agents_providers
1643
     */
1643
     */
Línea 1644... Línea 1644...
1644
    public function test_useragent_moodle_app($useragent, $tests) {
1644
    public function test_useragent_moodle_app($useragent, $tests): void {
1645
        // Setup the core_useragent instance.
1645
        // Setup the core_useragent instance.