You are here

protected function UnitsWebTestCase::assertEqualUnit in Units of Measurement 7

Same name and namespace in other branches
  1. 7.2 units.test \UnitsWebTestCase::assertEqualUnit()

Compare the provided unit to a standard one.

Parameters

Entity $unit: Unit that should be compared against standard

Entity $standard: Unit that is the standard one in the comparison

string $message: Assert message to display on the UI of the test result

1 call to UnitsWebTestCase::assertEqualUnit()
UnitsWebTestCase::testCrud in ./units.test
Conduct testing of CRUD operations.

File

./units.test, line 226
Tests for Units module.

Class

UnitsWebTestCase
@file Tests for Units module.

Code

protected function assertEqualUnit($unit, $standard, $message) {
  $success = $standard->umid == $unit->umid && $standard->machine_name == $unit->machine_name && $standard->measure == $unit->measure && $standard->label == $unit->label && $standard->factor == $unit->factor;
  $this
    ->assertTrue($success, $message, 'Units');
}