| = $this->getHtml('Status'); ?>
- | = !($recentHistory instanceof NullEmployeeHistory) ? $this->getHtml('Active') : $this->getHtml('Inactive'); ?>
+ | = $recentHistory->id > 0 ? $this->getHtml('Active') : $this->getHtml('Inactive'); ?>
diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php
index a8f3bcd..d3be785 100755
--- a/tests/Controller/ApiControllerTest.php
+++ b/tests/Controller/ApiControllerTest.php
@@ -129,7 +129,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
// can create multiple accounts if profiles is a list of ids e.g. 1,2,3
$this->module->apiEmployeeCreate($request, $response);
- self::assertGreaterThan(0, self::$employee = $response->get('')['response'][0]->getId());
+ self::assertGreaterThan(0, self::$employee = $response->get('')['response'][0]->id);
}
/**
@@ -145,7 +145,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$request->setData('name1', 'NewEmployee');
$this->module->apiEmployeeCreate($request, $response);
- self::assertGreaterThan(0, self::$employee = $response->get('')['response']->getId());
+ self::assertGreaterThan(0, self::$employee = $response->get('')['response']->id);
}
/**
@@ -225,7 +225,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$request->setData('department', 1);
$request->setData('position', 1);
$this->module->apiEmployeeHistoryCreate($request, $response);
- self::assertGreaterThan(0, $response->get('')['response']->getId());
+ self::assertGreaterThan(0, $response->get('')['response']->id);
$start = clone $end;
$end = DateTime::generateDateTime(
@@ -285,7 +285,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$request->setData('state', '');
$this->module->apiEmployeeWorkHistoryCreate($request, $response);
- self::assertGreaterThan(0, $response->get('')['response']->getId());
+ self::assertGreaterThan(0, $response->get('')['response']->id);
$start = clone $end;
$end = DateTime::generateDateTime(
@@ -346,7 +346,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$request->setData('state', '');
$this->module->apiEmployeeEducationHistoryCreate($request, $response);
- self::assertGreaterThan(0, $response->get('')['response']->getId());
+ self::assertGreaterThan(0, $response->get('')['response']->id);
$start = clone $end;
$end = DateTime::generateDateTime(
diff --git a/tests/Models/EmployeeEducationHistoryTest.php b/tests/Models/EmployeeEducationHistoryTest.php
index c906a7f..8207af8 100755
--- a/tests/Models/EmployeeEducationHistoryTest.php
+++ b/tests/Models/EmployeeEducationHistoryTest.php
@@ -37,7 +37,7 @@ final class EmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
- self::assertEquals(0, $this->history->getId());
+ self::assertEquals(0, $this->history->id);
self::assertNull($this->history->end);
self::assertEquals(0, $this->history->employee);
self::assertEquals('', $this->history->educationTitle);
diff --git a/tests/Models/EmployeeHistoryMapperTest.php b/tests/Models/EmployeeHistoryMapperTest.php
index d2ebb55..9539191 100755
--- a/tests/Models/EmployeeHistoryMapperTest.php
+++ b/tests/Models/EmployeeHistoryMapperTest.php
@@ -35,10 +35,10 @@ final class EmployeeHistoryMapperTest extends \PHPUnit\Framework\TestCase
$history = new EmployeeHistory($employee);
$id = EmployeeHistoryMapper::create()->execute($history);
- self::assertGreaterThan(0, $history->getId());
- self::assertEquals($id, $history->getId());
+ self::assertGreaterThan(0, $history->id);
+ self::assertEquals($id, $history->id);
- $historyR = EmployeeHistoryMapper::get()->where('id', $history->getId())->execute();
- self::assertEquals($history->employee->getId(), $historyR->employee->getId());
+ $historyR = EmployeeHistoryMapper::get()->where('id', $history->id)->execute();
+ self::assertEquals($history->employee->id, $historyR->employee->id);
}
}
diff --git a/tests/Models/EmployeeMapperTest.php b/tests/Models/EmployeeMapperTest.php
index eb5cd4a..0f79b0a 100755
--- a/tests/Models/EmployeeMapperTest.php
+++ b/tests/Models/EmployeeMapperTest.php
@@ -31,7 +31,7 @@ final class EmployeeMapperTest extends \PHPUnit\Framework\TestCase
*/
public function testCR() : void
{
- if (($profile = ProfileMapper::get()->where('account', 1)->execute())->getId() === 0) {
+ if (($profile = ProfileMapper::get()->where('account', 1)->execute())->id === 0) {
$profile = new Profile();
$profile->account = AccountMapper::get()->where('id', 1)->execute();
@@ -43,11 +43,11 @@ final class EmployeeMapperTest extends \PHPUnit\Framework\TestCase
$employee = new Employee($profile);
$id = EmployeeMapper::create()->execute($employee);
- self::assertGreaterThan(0, $employee->getId());
- self::assertEquals($id, $employee->getId());
+ self::assertGreaterThan(0, $employee->id);
+ self::assertEquals($id, $employee->id);
- $employeeR = EmployeeMapper::get()->where('id', $employee->getId())->execute();
- self::assertEquals($employee->profile->getId(), $employeeR->profile->getId());
- self::assertGreaterThan(0, EmployeeMapper::get()->with('profile')->where('profile/account', 1)->limit(1)->execute()->getId());
+ $employeeR = EmployeeMapper::get()->where('id', $employee->id)->execute();
+ self::assertEquals($employee->profile->id, $employeeR->profile->id);
+ self::assertGreaterThan(0, EmployeeMapper::get()->with('profile')->where('profile/account', 1)->limit(1)->execute()->id);
}
}
diff --git a/tests/Models/EmployeeTest.php b/tests/Models/EmployeeTest.php
index 337654e..bb10f0c 100755
--- a/tests/Models/EmployeeTest.php
+++ b/tests/Models/EmployeeTest.php
@@ -40,7 +40,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
- self::assertEquals(0, $this->employee->getId());
+ self::assertEquals(0, $this->employee->id);
self::assertGreaterThan(0, \strlen($this->employee->getSemiPrivateHash()));
self::assertFalse($this->employee->compareSemiPrivateHash('123'));
self::assertInstanceOf('\Modules\Media\Models\NullMedia', $this->employee->image);
diff --git a/tests/Models/EmployeeWorkHistoryTest.php b/tests/Models/EmployeeWorkHistoryTest.php
index 31d2aee..1992364 100755
--- a/tests/Models/EmployeeWorkHistoryTest.php
+++ b/tests/Models/EmployeeWorkHistoryTest.php
@@ -37,7 +37,7 @@ final class EmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
- self::assertEquals(0, $this->history->getId());
+ self::assertEquals(0, $this->history->id);
self::assertNull($this->history->end);
self::assertEquals(0, $this->history->employee);
self::assertEquals('', $this->history->jobTitle);
diff --git a/tests/Models/EmplyeeHistoryTest.php b/tests/Models/EmplyeeHistoryTest.php
index 7b2e07a..a66de0c 100755
--- a/tests/Models/EmplyeeHistoryTest.php
+++ b/tests/Models/EmplyeeHistoryTest.php
@@ -37,7 +37,7 @@ final class EmployeeHistoryTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
- self::assertEquals(0, $this->history->getId());
+ self::assertEquals(0, $this->history->id);
self::assertNull($this->history->end);
self::assertEquals(0, $this->history->employee);
self::assertInstanceOf('\Modules\Organization\Models\NullPosition', $this->history->position);
diff --git a/tests/Models/NullEmployeeEducationHistoryTest.php b/tests/Models/NullEmployeeEducationHistoryTest.php
index cfa0224..971317e 100755
--- a/tests/Models/NullEmployeeEducationHistoryTest.php
+++ b/tests/Models/NullEmployeeEducationHistoryTest.php
@@ -37,6 +37,6 @@ final class NullEmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase
public function testId() : void
{
$null = new NullEmployeeEducationHistory(2);
- self::assertEquals(2, $null->getId());
+ self::assertEquals(2, $null->id);
}
}
diff --git a/tests/Models/NullEmployeeHistoryTest.php b/tests/Models/NullEmployeeHistoryTest.php
index a454408..af546ab 100755
--- a/tests/Models/NullEmployeeHistoryTest.php
+++ b/tests/Models/NullEmployeeHistoryTest.php
@@ -37,6 +37,6 @@ final class NullEmployeeHistoryTest extends \PHPUnit\Framework\TestCase
public function testId() : void
{
$null = new NullEmployeeHistory(2);
- self::assertEquals(2, $null->getId());
+ self::assertEquals(2, $null->id);
}
}
diff --git a/tests/Models/NullEmployeeTest.php b/tests/Models/NullEmployeeTest.php
index 2589ba8..7301315 100755
--- a/tests/Models/NullEmployeeTest.php
+++ b/tests/Models/NullEmployeeTest.php
@@ -37,6 +37,6 @@ final class NullEmployeeTest extends \PHPUnit\Framework\TestCase
public function testId() : void
{
$null = new NullEmployee(2);
- self::assertEquals(2, $null->getId());
+ self::assertEquals(2, $null->id);
}
}
diff --git a/tests/Models/NullEmployeeWorkHistoryTest.php b/tests/Models/NullEmployeeWorkHistoryTest.php
index 3f8b01f..27265ce 100755
--- a/tests/Models/NullEmployeeWorkHistoryTest.php
+++ b/tests/Models/NullEmployeeWorkHistoryTest.php
@@ -37,6 +37,6 @@ final class NullEmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase
public function testId() : void
{
$null = new NullEmployeeWorkHistory(2);
- self::assertEquals(2, $null->getId());
+ self::assertEquals(2, $null->id);
}
}
|