🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.1 KiB
PHP
Executable File
55 lines
1.1 KiB
PHP
Executable File
<?php
|
|
class serverroomTest
|
|
{
|
|
public function __construct()
|
|
{
|
|
global $tester;
|
|
$this->objectModel = $tester->loadModel('serverroom');
|
|
}
|
|
|
|
/**
|
|
* Test create method.
|
|
*
|
|
* @param object $roomData
|
|
* @access public
|
|
* @return mixed
|
|
*/
|
|
public function createTest(object $roomData)
|
|
{
|
|
$result = $this->objectModel->create($roomData);
|
|
if(dao::isError()) return dao::getError();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* Test update method.
|
|
*
|
|
* @param int $roomID
|
|
* @param object $roomData
|
|
* @access public
|
|
* @return array|bool
|
|
*/
|
|
public function updateTest(int $roomID, object $roomData): array|bool
|
|
{
|
|
$result = $this->objectModel->update($roomID, $roomData);
|
|
if($result) return $result;
|
|
|
|
return dao::getError();
|
|
}
|
|
|
|
/**
|
|
* Test getPairs method.
|
|
*
|
|
* @access public
|
|
* @return array
|
|
*/
|
|
public function getPairsTest(): array
|
|
{
|
|
$result = $this->objectModel->getPairs();
|
|
if(dao::isError()) return dao::getError();
|
|
|
|
return $result;
|
|
}
|
|
}
|