13 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Jake Dallimore
b145fe216c MDL-67593 core_iplookup: use MaxMind test database in unit tests
Instead of downloading a live database (now not available publicly)
use a local test database.
2019-12-31 15:01:51 +08:00
Eloy Lafuente (stronk7)
83c64f78c0 Merge branch 'MDL-36941_master-fix' of git://github.com/markn86/moodle 2018-03-28 18:42:18 +02:00
Andrew Nicols
215cd2d854 MDL-61770 iplookup: Check types rather than values 2018-03-28 10:54:10 +08:00
Andrew Nicols
2cf6b060cd MDL-61169 iplookup: Change to github.com IP 2018-01-08 17:15:12 +08:00
Dan Poltawski
2fe28e0dc3 MDL-56740 geoip tests: update to a more reliable ipv6 location
Hopefully. It's quite difficult for us to test this funcionality with
altering data sets. Hoping this UCLA v6 address will be more reliable.
2016-11-04 08:52:40 +00:00
Dan Poltawski
a4a815f31c MDL-56331 tests: update with current coordinates
The previous commit will minor updates to pass, but this updates
to current values.
2016-10-10 09:10:07 +01:00
Dan Poltawski
0b73876317 MDL-56331 tests: increase tolerance of coordinate tests
1) It seems the maxmind database is getting relatively frequent updates
which are causing differences in exact coordinates

2) GeoIP location lookups are not an exact science, I tried to pick some
ips which I thought would remain fairly static, but these things are
just guesses.

3) Moving to 2 decimal places should give us good enough results for
this test, according to:
http://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude

  "The second decimal place is worth up to 1.1 km: it can separate one
   village from the next."
  "The third decimal place is worth up to 110 m: it can identify a
   large agricultural field or institutional campus."
2016-10-10 09:07:38 +01:00
Dan Poltawski
c307689792 MDL-48766 tests: move from Liberec to Cambridge
(liberec ip seemed to have been identified as a new location nearby now,
hoping cambridge will be stable)
2016-09-19 08:59:39 +01:00
Dan Poltawski
3fad0f1a24 MDL-48766 iplookup: Update to geoip2 db to support ipv6
The previous maxmind geoip database is now legacy and the GeoIP2
version supports ipv6.
2016-09-19 08:59:39 +01:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Petr Skoda
64b0f3ab68 MDL-32868 fix iplookup inconsistencies and add missing unit tests
Please note you need to define PHPUNIT_LONGTEST in config.php or phpunit.xml to get the tests to execute because it takes long time to fetch the geoip data and we do not want to DDOS geoPlugin server.
2012-05-12 14:25:01 +02:00