wiki.techinc.nl/tests/phpunit/unit/includes/libs/Metrics
Timo Tijhof f603b00abf Metrics: Add test coverage for getRenderedSamples() and send()
Also various other code clean ups:

* Fix warning during PHPUnit coverage run for invalid @coverage target:

> 1) Wikimedia\Tests\Metrics\MetricTest::testValidateLabels
> Trying to @cover not existing class "\Wikimedia\Metrics\Metric".

* Move "expectException" lines to right above the expected failure
  instead of at the start of the method, which aligns with how this
  is typically done in PHPUnit tests.

* Remove TestCase constructor overrides. This is not supported by
  upstream. We generally use setUp() or setUpBeforeClass() for this.

  In this case, remove it entirely in favour of NullLogger without
  any re-use between test methods.

* Change github.com URL to permalink.

* Favour early returns for error handling to separate input validation
  from storing in-object which makes it harder to separate what is and
  isn't valid at any particular point. This is mostly for consistency
  with other MW code, but also happens to make the code simpler in
  this case.

Bug: T240685
Change-Id: I36368cc0aadff7e24fe55dec2eda1365efd779af
2021-10-23 03:13:40 +00:00
..
MetricsFactoryTest.php
MetricTest.php
SampleTest.php