Merge branch 'develop' into feature/exception-tests
This commit is contained in:
commit
37a5e29db9
135 changed files with 241 additions and 209 deletions
|
@ -124,7 +124,7 @@ class BulkPowerActionCommandTest extends CommandTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that validation occurrs correctly.
|
||||
* Test that validation occurs correctly.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ class HumanReadableTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Provide data to test aganist the helper function.
|
||||
* Provide data to test against the helper function.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ class IsDigitTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Provide data to test aganist the helper function.
|
||||
* Provide data to test against the helper function.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -79,7 +79,7 @@ class RemoteRequestControllerTest extends ControllerTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that the controller properly handles an exception thrown by the daemon conneciton.
|
||||
* Test that the controller properly handles an exception thrown by the daemon connection.
|
||||
*/
|
||||
public function testExceptionThrownByDaemonConnectionIsHandledByDisplayController()
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ class RemoteRequestControllerTest extends ControllerTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that the controller properly handles an exception thrown by the daemon conneciton.
|
||||
* Test that the controller properly handles an exception thrown by the daemon connection.
|
||||
*/
|
||||
public function testExceptionThrownByDaemonConnectionIsHandledByStoreController()
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ class AuthenticateIPAccessTest extends MiddlewareTestCase
|
|||
/**
|
||||
* Test that a CIDR range can be used.
|
||||
*/
|
||||
public function testValidIPAganistCIDRRange()
|
||||
public function testValidIPAgainstCIDRRange()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make(['allowed_ips' => '["192.168.1.1/28"]']);
|
||||
$this->setRequestAttribute('api_key', $model);
|
||||
|
|
|
@ -59,7 +59,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that an invalid API identifer throws an exception.
|
||||
* Test that an invalid API identifier throws an exception.
|
||||
*
|
||||
* @expectedException \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
|
||||
*/
|
||||
|
|
|
@ -103,7 +103,7 @@ class RunTaskJobTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test commmand action passed to job.
|
||||
* Test command action passed to job.
|
||||
*/
|
||||
public function testCommandAction()
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ class AdminAclTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that checking aganist a model works as expected.
|
||||
* Test that checking against a model works as expected.
|
||||
*/
|
||||
public function testCheck()
|
||||
{
|
||||
|
|
|
@ -103,7 +103,7 @@ class AssignmentServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test a non-CIRD IP address with a single port and an alias.
|
||||
* Test a non-CIDR IP address with a single port and an alias.
|
||||
*/
|
||||
public function testIndividualIPAddressWithAlias()
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ class InstallScriptServiceTest extends TestCase
|
|||
{
|
||||
$this->data['copy_script_from'] = 1;
|
||||
|
||||
$this->repository->shouldReceive('isCopiableScript')->with(1, $this->model->nest_id)->once()->andReturn(true);
|
||||
$this->repository->shouldReceive('isCopyableScript')->with(1, $this->model->nest_id)->once()->andReturn(true);
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('update')->with($this->model->id, $this->data)->andReturnNull();
|
||||
|
||||
|
@ -73,13 +73,13 @@ class InstallScriptServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that an exception gets raised when the script is not copiable.
|
||||
* Test that an exception gets raised when the script is not copyable.
|
||||
*/
|
||||
public function testUpdateWithInvalidCopyScriptFromAttribute()
|
||||
{
|
||||
$this->data['copy_script_from'] = 1;
|
||||
|
||||
$this->repository->shouldReceive('isCopiableScript')->with(1, $this->model->nest_id)->once()->andReturn(false);
|
||||
$this->repository->shouldReceive('isCopyableScript')->with(1, $this->model->nest_id)->once()->andReturn(false);
|
||||
try {
|
||||
$this->service->handle($this->model, $this->data);
|
||||
} catch (Exception $exception) {
|
||||
|
|
|
@ -68,7 +68,7 @@ class VariableCreationServiceTest extends TestCase
|
|||
|
||||
/**
|
||||
* Test that an empty (null) value passed in the option key is handled
|
||||
* properly as an array. Also tests the same case aganist the default_value.
|
||||
* properly as an array. Also tests the same case against the default_value.
|
||||
*
|
||||
* @see https://github.com/Pterodactyl/Panel/issues/841
|
||||
* @see https://github.com/Pterodactyl/Panel/issues/943
|
||||
|
|
|
@ -153,7 +153,7 @@ class SoftwareVersionServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Provide data for testing booklean response for daemon version.
|
||||
* Provide data for testing boolean response for daemon version.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -154,7 +154,7 @@ class PackCreationServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Return an array of valid mimetypes to test aganist.
|
||||
* Return an array of valid mimetypes to test against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -167,7 +167,7 @@ class PackCreationServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Provide invalid mimetypes to test exceptions aganist.
|
||||
* Provide invalid mimetypes to test exceptions against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ class ProcessScheduleServiceTest extends TestCase
|
|||
|
||||
$this->repository->shouldReceive('loadTasks')->with($model)->once()->andReturn($model);
|
||||
|
||||
$formatted = sprintf('%s %s %s * %s *', $model->cron_minute, $model->cron_hour, $model->cron_day_of_month, $model->cron_day_of_week);
|
||||
$formatted = sprintf('%s %s %s * %s', $model->cron_minute, $model->cron_hour, $model->cron_day_of_month, $model->cron_day_of_week);
|
||||
$this->repository->shouldReceive('update')->with($model->id, [
|
||||
'is_processing' => true,
|
||||
'next_run_at' => CronExpression::factory($formatted)->getNextRunDate(),
|
||||
|
|
|
@ -64,7 +64,7 @@ class ScheduleCreationServiceTest extends TestCase
|
|||
$this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('create')->with([
|
||||
'server_id' => $server->id,
|
||||
'next_run_at' => CronExpression::factory('* * * * * *')->getNextRunDate(),
|
||||
'next_run_at' => CronExpression::factory('* * * * *')->getNextRunDate(),
|
||||
'test_key' => 'value',
|
||||
])->once()->andReturn($schedule);
|
||||
$this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull();
|
||||
|
@ -85,7 +85,7 @@ class ScheduleCreationServiceTest extends TestCase
|
|||
$this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('create')->with([
|
||||
'server_id' => $server->id,
|
||||
'next_run_at' => CronExpression::factory('* * * * * *')->getNextRunDate(),
|
||||
'next_run_at' => CronExpression::factory('* * * * *')->getNextRunDate(),
|
||||
'test_key' => 'value',
|
||||
])->once()->andReturn($schedule);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class ScheduleUpdateServiceTest extends TestCase
|
|||
|
||||
$this->connection->shouldReceive('beginTransaction')->once()->withNoArgs();
|
||||
$this->repository->shouldReceive('update')->once()->with($schedule->id, array_merge($data, [
|
||||
'next_run_at' => CronExpression::factory('1 2 3 * 4 *')->getNextRunDate(),
|
||||
'next_run_at' => CronExpression::factory('1 2 3 * 4')->getNextRunDate(),
|
||||
]))->andReturn($schedule);
|
||||
|
||||
$this->taskRepository->shouldReceive('deleteWhere')->once()->with([['schedule_id', '=', $schedule->id]]);
|
||||
|
|
|
@ -149,7 +149,7 @@ class TaskCreationServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that exceptions are thrown if the Scheudle module or ID is invalid.
|
||||
* Test that exceptions are thrown if the Schedule module or ID is invalid.
|
||||
*
|
||||
* @dataProvider invalidScheduleArgumentProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
|
@ -190,7 +190,7 @@ class TaskCreationServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Return an array of invalid schedule data to test aganist.
|
||||
* Return an array of invalid schedule data to test against.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,7 @@ class EnvironmentServiceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Test that set environment key stores the key into a retreviable array.
|
||||
* Test that set environment key stores the key into a retrievable array.
|
||||
*/
|
||||
public function testSettingEnvironmentKeyPersistsItInArray()
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ class EnvironmentServiceTest extends TestCase
|
|||
/**
|
||||
* Test that duplicate variables provided in config override the defaults.
|
||||
*/
|
||||
public function testProcessShouldAllowOverwritingVaraiblesWithConfigurationFile()
|
||||
public function testProcessShouldAllowOverwritingVariablesWithConfigurationFile()
|
||||
{
|
||||
$model = $this->getServerModel();
|
||||
$this->repository->shouldReceive('getVariablesWithValues')->with($model->id)->once()->andReturn([]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue