Skip to content

Commit

Permalink
Merge branch 'pu/ps/hrTestFix' into '2024.11'
Browse files Browse the repository at this point in the history
test(HumanResources/Employee): result set order should not matter

See merge request tine20/tine20!4860
  • Loading branch information
pschuele committed Jan 31, 2024
2 parents 44dbbb2 + 62373fe commit 05755f3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/tine20/HumanResources/Controller/EmployeeTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ public function testFilters()
'dir' => 'ASC',
'model' => HumanResources_Model_Employee::class,
]));
$msg = 'rwright and pwulf should have been found';
$msg = 'rwright and pwulf should have been found in ' . print_r($result->toArray(), true);
$this->assertEquals(2, $result->count(), $msg);
$this->assertSame('Roberta Wright', $result->getFirstRecord()->n_fn);
$this->assertSame('Paul Wulf', $result->getLastRecord()->n_fn);

$this->assertNotNull($result->filter('n_fn', 'Roberta Wright')->getFirstRecord(), $msg);
$this->assertNotNull($result->filter('n_fn', 'Paul Wulf')->getFirstRecord(), $msg);

$filter = new HumanResources_Model_EmployeeFilter(array(
array('field' => 'is_employed', 'operator' => 'equals', 'value' => FALSE)
Expand All @@ -215,9 +214,9 @@ public function testFilters()
'model' => HumanResources_Model_Employee::class,
]));

$msg = 'jsmith and jmcblack should have been found';
$msg = 'jsmith and jmcblack should have been found in ' . print_r($result->toArray(), true);
$this->assertEquals(2, $result->count(), $msg);
$this->assertSame('John Smith', $result->getFirstRecord()->n_fn);
$this->assertSame('James McBlack', $result->getLastRecord()->n_fn);
$this->assertNotNull($result->filter('n_fn', 'John Smith')->getFirstRecord(), $msg);
$this->assertNotNull($result->filter('n_fn', 'James McBlack')->getFirstRecord(), $msg);
}
}

0 comments on commit 05755f3

Please sign in to comment.