How to use runner class

Best Atoum code snippet using runner

RunnerTest.php

Source:RunnerTest.php Github

copy

Full Screen

...16{17 /**18 * @var Runner19 */20 protected $runner;21 public function setUp()22 {23 $this->runner = new Runner();24 }25 public function checksAndResultsProvider()26 {27 return array(28 array(29 $success = new Success(),30 $success,31 ),32 array(33 $warning = new Warning(),34 $warning,35 ),36 array(37 $failure = new Failure(),38 $failure,39 ),40 array(41 $unknown = new Unknown(),42 $unknown,43 ),44 array(45 true,46 'ZendDiagnostics\Result\Success'47 ),48 array(49 false,50 'ZendDiagnostics\Result\Failure'51 ),52 array(53 null,54 'ZendDiagnostics\Result\Failure',55 ),56 array(57 new \stdClass(),58 'ZendDiagnostics\Result\Failure',59 ),60 array(61 'abc',62 'ZendDiagnostics\Result\Warning',63 ),64 );65 }66 public function testConfig()67 {68 $this->assertFalse($this->runner->getBreakOnFailure());69 $this->assertTrue(is_numeric($this->runner->getCatchErrorSeverity()));70 $this->runner->setConfig(array(71 'break_on_failure' => true,72 'catch_error_severity' => 10073 ));74 $this->assertTrue($this->runner->getBreakOnFailure());75 $this->assertSame(100, $this->runner->getCatchErrorSeverity());76 $this->runner->setBreakOnFailure(false);77 $this->runner->setCatchErrorSeverity(200);78 $this->assertFalse($this->runner->getBreakOnFailure());79 $this->assertSame(200, $this->runner->getCatchErrorSeverity());80 $this->runner = new Runner(array(81 'break_on_failure' => true,82 'catch_error_severity' => 30083 ));84 $this->assertTrue($this->runner->getBreakOnFailure());85 $this->assertSame(300, $this->runner->getCatchErrorSeverity());86 $this->assertEquals(array(87 'break_on_failure' => true,88 'catch_error_severity' => 30089 ), $this->runner->getConfig());90 }91 public function testInvalidValueForSetConfig()92 {93 $this->setExpectedException('InvalidArgumentException');94 $this->runner->setConfig(10);95 }96 public function testUnknownValueInConfig()97 {98 $this->setExpectedException('BadMethodCallException');99 $this->runner->setConfig(array(100 'foo' => 'bar'101 ));102 }103 public function testManagingChecks()104 {105 $check1 = new AlwaysSuccess();106 $check2 = new AlwaysSuccess();107 $check3 = new AlwaysSuccess();108 $this->runner->addCheck($check1);109 $this->runner->addChecks(array(110 $check2,111 $check3112 ));113 $this->assertContains($check1, $this->runner->getChecks());114 $this->assertContains($check2, $this->runner->getChecks());115 $this->assertContains($check3, $this->runner->getChecks());116 }117 public function testManagingChecksWithAliases()118 {119 $check1 = new AlwaysSuccess();120 $check2 = new AlwaysSuccess();121 $check3 = new AlwaysSuccess();122 $this->runner->addCheck($check1, 'foo');123 $this->runner->addCheck($check2, 'bar');124 $this->assertSame($check1, $this->runner->getCheck('foo'));125 $this->assertSame($check2, $this->runner->getCheck('bar'));126 $this->runner->addChecks(array(127 'baz' => $check3,128 ));129 $this->assertSame($check3, $this->runner->getCheck('baz'));130 }131 public function testGetNonExistentAliasThrowsException()132 {133 $this->setExpectedException('RuntimeException');134 $this->runner->getCheck('non-existent-check');135 }136 public function testConstructionWithChecks()137 {138 $check1 = new AlwaysSuccess();139 $check2 = new AlwaysSuccess();140 $this->runner = new Runner(array(), array($check1, $check2));141 $this->assertEquals(2, count($this->runner->getChecks()));142 $this->assertContains($check1, $this->runner->getChecks());143 $this->assertContains($check2, $this->runner->getChecks());144 }145 public function testConstructionWithReporter()146 {147 $reporter = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter');148 $this->runner = new Runner(array(), array(), $reporter);149 $this->assertEquals(1, count($this->runner->getReporters()));150 $this->assertContains($reporter, $this->runner->getReporters());151 }152 public function testAddInvalidCheck()153 {154 $this->setExpectedException('InvalidArgumentException');155 $this->runner->addChecks(array( new \stdClass()));156 }157 public function testAddWrongParam()158 {159 $this->setExpectedException('InvalidArgumentException');160 $this->runner->addChecks('foo');161 }162 public function testAddReporter()163 {164 $reporter = new BasicConsole();165 $this->runner->addReporter($reporter);166 $this->assertContains($reporter, $this->runner->getReporters());167 }168 public function testRemoveReporter()169 {170 $reporter1 = new BasicConsole();171 $reporter2 = new BasicConsole();172 $this->runner->addReporter($reporter1);173 $this->runner->addReporter($reporter2);174 $this->assertContains($reporter1, $this->runner->getReporters());175 $this->assertContains($reporter2, $this->runner->getReporters());176 $this->runner->removeReporter($reporter1);177 $this->assertNotContains($reporter1, $this->runner->getReporters());178 $this->assertContains($reporter2, $this->runner->getReporters());179 }180 public function testStart()181 {182 $this->runner->addCheck(new AlwaysSuccess());183 $mock = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter', array('onStart'));184 $mock->expects($this->once())->method('onStart')->with($this->isInstanceOf('\ArrayObject'), $this->isType('array'));185 $this->runner->addReporter($mock);186 $this->runner->run();187 }188 public function testBeforeRun()189 {190 $check = new AlwaysSuccess();191 $this->runner->addCheck($check);192 $mock = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter', array('onBeforeRun'));193 $mock->expects($this->once())->method('onBeforeRun')->with($this->identicalTo($check));194 $this->runner->addReporter($mock);195 $this->runner->run();196 }197 public function testAfterRun()198 {199 $check = new AlwaysSuccess();200 $this->runner->addCheck($check);201 $mock = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter', array('onAfterRun'));202 $mock->expects($this->once())->method('onAfterRun')->with($this->identicalTo($check));203 $this->runner->addReporter($mock);204 $this->runner->run();205 }206 /**207 * @dataProvider checksAndResultsProvider208 */209 public function testStandardResults($value, $expectedResult)210 {211 $check = new ReturnThis($value);212 $this->runner->addCheck($check);213 $results = $this->runner->run();214 if (is_string($expectedResult)) {215 $this->assertInstanceOf($expectedResult, $results[$check]);216 } else {217 $this->assertSame($expectedResult, $results[$check]);218 }219 }220 public function testGetLastResult()221 {222 $this->runner->addCheck(new AlwaysSuccess());223 $result = $this->runner->run();224 $this->assertInstanceOf('ZendDiagnostics\Result\Collection', $result);225 $this->assertSame($result, $this->runner->getLastResults());226 }227 public function testExceptionResultsInFailure()228 {229 $exception = new \Exception();230 $check = new ThrowException($exception);231 $this->runner->addCheck($check);232 $results = $this->runner->run();233 $this->assertInstanceOf('ZendDiagnostics\Result\Failure', $results[$check]);234 }235 public function testPHPWarningResultsInFailure()236 {237 $check = new TriggerWarning();238 $this->runner->addCheck($check);239 $results = $this->runner->run();240 $this->assertInstanceOf('ZendDiagnostics\Result\Failure', $results[$check]);241 $this->assertInstanceOf('ErrorException', $results[$check]->getData());242 $this->assertEquals(E_WARNING, $results[$check]->getData()->getSeverity());243 }244 public function testPHPUserErrorResultsInFailure()245 {246 $check = new TriggerUserError('error', E_USER_ERROR);247 $this->runner->addCheck($check);248 $results = $this->runner->run();249 $this->assertInstanceOf('ZendDiagnostics\Result\Failure', $results[$check]);250 $this->assertInstanceOf('ErrorException', $results[$check]->getData());251 $this->assertEquals(E_USER_ERROR, $results[$check]->getData()->getSeverity());252 }253 public function testBreakOnFirstFailure()254 {255 $check1 = new AlwaysFailure();256 $check2 = new AlwaysSuccess();257 $this->runner->addCheck($check1);258 $this->runner->addCheck($check2);259 $this->runner->setBreakOnFailure(true);260 $results = $this->runner->run();261 $this->assertInstanceOf('ZendDiagnostics\Result\Collection', $results);262 $this->assertEquals(1, $results->count());263 $this->assertFalse($results->offsetExists($check2));264 $this->assertInstanceOf('ZendDiagnostics\Result\FailureInterface', $results->offsetGet($check1));265 }266 public function testBeforeRunSkipTest()267 {268 $check1 = new AlwaysSuccess();269 $check2 = new AlwaysSuccess();270 $this->runner->addCheck($check1);271 $this->runner->addCheck($check2);272 $mock = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter', array('onBeforeRun'));273 $mock->expects($this->atLeastOnce())274 ->method('onBeforeRun')275 ->with($this->isInstanceOf('ZendDiagnostics\Check\CheckInterface'))276 ->will($this->onConsecutiveCalls(277 false, true278 ))279 ;280 $this->runner->addReporter($mock);281 $results = $this->runner->run();282 $this->assertInstanceOf('ZendDiagnostics\Result\Collection', $results);283 $this->assertEquals(1, $results->count());284 $this->assertFalse($results->offsetExists($check1));285 $this->assertInstanceOf('ZendDiagnostics\Result\SuccessInterface', $results->offsetGet($check2));286 }287 public function testAfterRunStopTesting()288 {289 $check1 = new AlwaysSuccess();290 $check2 = new AlwaysSuccess();291 $this->runner->addCheck($check1);292 $this->runner->addCheck($check2);293 $mock = $this->getMock('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter', array('onAfterRun'));294 $mock->expects($this->atLeastOnce())295 ->method('onAfterRun')296 ->with($this->isInstanceOf('ZendDiagnostics\Check\CheckInterface'))297 ->will($this->onConsecutiveCalls(298 false, true299 ))300 ;301 $this->runner->addReporter($mock);302 $results = $this->runner->run();303 $this->assertInstanceOf('ZendDiagnostics\Result\Collection', $results);304 $this->assertEquals(1, $results->count());305 $this->assertFalse($results->offsetExists($check2));306 $this->assertInstanceOf('ZendDiagnostics\Result\SuccessInterface', $results->offsetGet($check1));307 }308}...

Full Screen

Full Screen

TaskRunnerStarter.php

Source:TaskRunnerStarter.php Github

copy

Full Screen

...17 */18class TaskRunnerStarter implements Runnable19{20 /**21 * Unique runner guid.22 *23 * @var string24 */25 private $guid;26 /**27 * Instance of task runner status storage.28 *29 * @var TaskRunnerStatusStorage30 */31 private $runnerStatusStorage;32 /**33 * Instance of task runner.34 *35 * @var TaskRunner36 */37 private $taskRunner;38 /**39 * Instance of task runner wakeup service.40 *41 * @var TaskRunnerWakeup42 */43 private $taskWakeup;44 /**45 * TaskRunnerStarter constructor.46 *47 * @param string $guid Unique runner guid.48 */49 public function __construct($guid)50 {51 $this->guid = $guid;52 }53 /**54 * Transforms array into an serializable object,55 *56 * @param array $array Data that is used to instantiate serializable object.57 *58 * @return \Logeecom\Infrastructure\Serializer\Interfaces\Serializable59 * Instance of serialized object.60 */61 public static function fromArray(array $array)62 {63 return new static($array['guid']);64 }65 /**66 * Transforms serializable object into an array.67 *68 * @return array Array representation of a serializable object.69 */70 public function toArray()71 {72 return array('guid' => $this->guid);73 }74 /**75 * String representation of object.76 *77 * @inheritdoc78 */79 public function serialize()80 {81 return Serializer::serialize(array($this->guid));82 }83 /**84 * Constructs the object.85 *86 * @inheritdoc87 */88 public function unserialize($serialized)89 {90 list($this->guid) = Serializer::unserialize($serialized);91 }92 /**93 * Get unique runner guid.94 *95 * @return string Unique runner string.96 */97 public function getGuid()98 {99 return $this->guid;100 }101 /**102 * Starts synchronously currently active task runner instance.103 */104 public function run()105 {106 try {107 $this->doRun();108 } catch (TaskRunnerStatusStorageUnavailableException $ex) {109 Logger::logError(110 'Failed to run task runner. Runner status storage unavailable.',111 'Core',112 array('ExceptionMessage' => $ex->getMessage())113 );114 Logger::logDebug(115 'Failed to run task runner. Runner status storage unavailable.',116 'Core',117 array(118 'ExceptionMessage' => $ex->getMessage(),119 'ExceptionTrace' => $ex->getTraceAsString(),120 )121 );122 } catch (TaskRunnerRunException $ex) {123 Logger::logInfo($ex->getMessage());124 Logger::logDebug($ex->getMessage(), 'Core', array('ExceptionTrace' => $ex->getTraceAsString()));125 } catch (\Exception $ex) {126 Logger::logError(127 'Failed to run task runner. Unexpected error occurred.',128 'Core',129 array('ExceptionMessage' => $ex->getMessage())130 );131 Logger::logDebug(132 'Failed to run task runner. Unexpected error occurred.',133 'Core',134 array(135 'ExceptionMessage' => $ex->getMessage(),136 'ExceptionTrace' => $ex->getTraceAsString(),137 )138 );139 }140 }141 /**142 * Runs task execution.143 *144 * @throws \Logeecom\Infrastructure\TaskExecution\Exceptions\TaskRunnerRunException145 * @throws \Logeecom\Infrastructure\TaskExecution\Exceptions\TaskRunnerStatusStorageUnavailableException146 */147 private function doRun()148 {149 $runnerStatus = $this->getRunnerStorage()->getStatus();150 if ($this->guid !== $runnerStatus->getGuid()) {151 throw new TaskRunnerRunException('Failed to run task runner. Runner guid is not set as active.');152 }153 if ($runnerStatus->isExpired()) {154 $this->getTaskWakeup()->wakeup();155 throw new TaskRunnerRunException('Failed to run task runner. Runner is expired.');156 }157 $this->getTaskRunner()->setGuid($this->guid);158 $this->getTaskRunner()->run();159 /** @var EventBus $eventBus */160 $eventBus = ServiceRegister::getService(EventBus::CLASS_NAME);161 $eventBus->fire(new TickEvent());162 }163 /**164 * Gets task runner status storage instance.165 *166 * @return TaskRunnerStatusStorage Instance of runner status storage service.167 */168 private function getRunnerStorage()169 {170 if ($this->runnerStatusStorage === null) {171 $this->runnerStatusStorage = ServiceRegister::getService(TaskRunnerStatusStorage::CLASS_NAME);172 }173 return $this->runnerStatusStorage;174 }175 /**176 * Gets task runner instance.177 *178 * @return TaskRunner Instance of runner service.179 */180 private function getTaskRunner()181 {182 if ($this->taskRunner === null) {183 $this->taskRunner = ServiceRegister::getService(TaskRunner::CLASS_NAME);184 }185 return $this->taskRunner;186 }187 /**188 * Gets task runner wakeup instance.189 *190 * @return TaskRunnerWakeup Instance of runner wakeup service.191 */192 private function getTaskWakeup()193 {194 if ($this->taskWakeup === null) {195 $this->taskWakeup = ServiceRegister::getService(TaskRunnerWakeup::CLASS_NAME);196 }197 return $this->taskWakeup;198 }199}...

Full Screen

Full Screen

docker_test.go

Source:docker_test.go Github

copy

Full Screen

...22 return &r23}24func TestDockerCreate(t *testing.T) {25 ctx := context.Background()26 runnerOpts := getRunnerOptions()27 // test create container28 statusCreate := runner.Create(ctx, runnerOpts)29 if !statusCreate.Done {30 t.Errorf("error creating container: %v", statusCreate.Error)31 }32}33func TestDockerRun(t *testing.T) {34 ctx := context.Background()35 runnerOpts := getRunnerOptions()36 // test create container37 statusCreate := runner.Create(ctx, runnerOpts)38 if !statusCreate.Done {39 t.Errorf("error creating container: %v", statusCreate.Error)40 }41 if status := runner.Run(ctx, runnerOpts); !status.Done {42 t.Errorf("error in running container : %v", status.Error)43 return44 }45}46func TestDockerWaitCompletion(t *testing.T) {47 ctx := context.Background()48 runnerOpts := getRunnerOptions()49 // test create container50 statusCreate := runner.Create(ctx, runnerOpts)51 if !statusCreate.Done {52 t.Errorf("error creating container: %v", statusCreate.Error)53 }54 if status := runner.Run(ctx, runnerOpts); !status.Done {55 t.Errorf("error in running container : %v", status.Error)56 return57 }58 if err := runner.WaitForCompletion(ctx, runnerOpts); err != nil {59 t.Errorf("Error while waiting for completion of container")60 }61}62func TestDockerDestroyWithoutRunning(t *testing.T) {63 ctx := context.Background()64 os.Setenv(global.AutoRemoveEnv, strconv.FormatBool(false))65 runnerOpts := getRunnerOptions()66 // test create container67 statusCreate := runner.Create(ctx, runnerOpts)68 if !statusCreate.Done {69 t.Errorf("error creating container: %v", statusCreate.Error)70 }71 if err := runner.Destroy(ctx, runnerOpts); err != nil {72 t.Errorf("error destroying container: %v", err)73 }74}75func TestDockerDestroyWithRunningWoAutoRemove(t *testing.T) {76 ctx := context.Background()77 runnerOpts := getRunnerOptions()78 // test create container79 os.Setenv(global.AutoRemoveEnv, strconv.FormatBool(false))80 statusCreate := runner.Create(ctx, runnerOpts)81 if !statusCreate.Done {82 t.Errorf("error creating container: %v", statusCreate.Error)83 }84 if status := runner.Run(ctx, runnerOpts); !status.Done {85 t.Errorf("error in running container : %v", status.Error)86 return87 }88 if err := runner.Destroy(ctx, runnerOpts); err != nil {89 t.Errorf("error destroying container: %v", err)90 }91}92func TestDockerDestroyWithRunningWithAutoRemove(t *testing.T) {93 ctx := context.Background()94 runnerOpts := getRunnerOptions()95 // test create container96 os.Setenv(global.AutoRemoveEnv, strconv.FormatBool(true))97 statusCreate := runner.Create(ctx, runnerOpts)98 if !statusCreate.Done {99 t.Errorf("error creating container: %v", statusCreate.Error)100 }101 if status := runner.Run(ctx, runnerOpts); !status.Done {102 t.Errorf("error in running container : %v", status.Error)103 return104 }105 if err := runner.Destroy(ctx, runnerOpts); err != nil {106 t.Errorf("error destroying container: %v", err)107 }108}109func TestDockerPullAlways(t *testing.T) {110 runnerOpts := getRunnerOptions()111 // test create container112 runnerOpts.PodType = core.NucleusPod113 if err := runner.PullImage(&core.ContainerImageConfig{114 Mode: config.PublicMode,115 PullPolicy: config.PullAlways,116 Image: runnerOpts.DockerImage,117 }, runnerOpts); err != nil {118 t.Errorf("Error while pulling image %v", err)119 }120}121func TestDockerPullNever(t *testing.T) {122 runnerOpts := getRunnerOptions()123 // test create container124 runnerOpts.PodType = core.NucleusPod125 if err := runner.PullImage(&core.ContainerImageConfig{126 Mode: config.PublicMode,127 PullPolicy: config.PullNever,128 Image: "dummy-image",129 }, runnerOpts); err != nil {130 t.Errorf("Error while pulling image %v", err)131 }132}...

Full Screen

Full Screen

TaskRunner_gen.go

Source:TaskRunner_gen.go Github

copy

Full Screen

1// Code created from "class.go.tmpl" - don't edit by hand2package cef3import (4 // #include "capi_gen.h"5 // int gocef_task_runner_is_same(cef_task_runner_t * self, cef_task_runner_t * that, int (CEF_CALLBACK *callback__)(cef_task_runner_t *, cef_task_runner_t *)) { return callback__(self, that); }6 // int gocef_task_runner_belongs_to_current_thread(cef_task_runner_t * self, int (CEF_CALLBACK *callback__)(cef_task_runner_t *)) { return callback__(self); }7 // int gocef_task_runner_belongs_to_thread(cef_task_runner_t * self, cef_thread_id_t threadID, int (CEF_CALLBACK *callback__)(cef_task_runner_t *, cef_thread_id_t)) { return callback__(self, threadID); }8 // int gocef_task_runner_post_task(cef_task_runner_t * self, cef_task_t * task, int (CEF_CALLBACK *callback__)(cef_task_runner_t *, cef_task_t *)) { return callback__(self, task); }9 // int gocef_task_runner_post_delayed_task(cef_task_runner_t * self, cef_task_t * task, int64 delayMs, int (CEF_CALLBACK *callback__)(cef_task_runner_t *, cef_task_t *, int64)) { return callback__(self, task, delayMs); }10 "C"11)12// TaskRunner (cef_task_runner_t from include/capi/cef_task_capi.h)13// Structure that asynchronously executes tasks on the associated thread. It is14// safe to call the functions of this structure on any thread.15//16// CEF maintains multiple internal threads that are used for handling different17// types of tasks in different processes. The cef_thread_id_t definitions in18// cef_types.h list the common CEF threads. Task runners are also available for19// other CEF threads as appropriate (for example, V8 WebWorker threads).20type TaskRunner C.cef_task_runner_t21func (d *TaskRunner) toNative() *C.cef_task_runner_t {22 return (*C.cef_task_runner_t)(d)23}24// Base (base)25// Base structure.26func (d *TaskRunner) Base() *BaseRefCounted {27 return (*BaseRefCounted)(&d.base)28}29// IsSame (is_same)30// Returns true (1) if this object is pointing to the same task runner as31// |that| object.32func (d *TaskRunner) IsSame(that *TaskRunner) int32 {33 return int32(C.gocef_task_runner_is_same(d.toNative(), that.toNative(), d.is_same))34}35// BelongsToCurrentThread (belongs_to_current_thread)36// Returns true (1) if this task runner belongs to the current thread.37func (d *TaskRunner) BelongsToCurrentThread() int32 {38 return int32(C.gocef_task_runner_belongs_to_current_thread(d.toNative(), d.belongs_to_current_thread))39}40// BelongsToThread (belongs_to_thread)41// Returns true (1) if this task runner is for the specified CEF thread.42func (d *TaskRunner) BelongsToThread(threadID ThreadID) int32 {43 return int32(C.gocef_task_runner_belongs_to_thread(d.toNative(), C.cef_thread_id_t(threadID), d.belongs_to_thread))44}45// PostTask (post_task)46// Post a task for execution on the thread associated with this task runner.47// Execution will occur asynchronously.48func (d *TaskRunner) PostTask(task *Task) int32 {49 return int32(C.gocef_task_runner_post_task(d.toNative(), task.toNative(), d.post_task))50}51// PostDelayedTask (post_delayed_task)52// Post a task for delayed execution on the thread associated with this task53// runner. Execution will occur asynchronously. Delayed tasks are not54// supported on V8 WebWorker threads and will be executed without the55// specified delay.56func (d *TaskRunner) PostDelayedTask(task *Task, delayMs int64) int32 {57 return int32(C.gocef_task_runner_post_delayed_task(d.toNative(), task.toNative(), C.int64(delayMs), d.post_delayed_task))58}...

Full Screen

Full Screen

GetCandyInstaller.php

Source:GetCandyInstaller.php Github

copy

Full Screen

...24 * @var \Illuminate\Console\Command25 */26 protected $command;27 /**28 * The runner classes that should be executed.29 *30 * @var array31 */32 protected $runners = [33 'preflight' => PreflightRunner::class,34 'settings' => SettingsRunner::class,35 'customer_groups' => CustomerGroupRunner::class,36 'languages' => LanguageRunner::class,37 'taxes' => TaxRunner::class,38 'attributes' => AttributeRunner::class,39 'currencies' => CurrencyRunner::class,40 'assets' => AssetRunner::class,41 'association_groups' => AssociationGroupRunner::class,42 'countries' => CountryRunner::class,43 'users' => UserRunner::class,44 'channels' => ChannelRunner::class,45 'product_families' => ProductFamilyRunner::class,46 'payment_types' => PaymentTypeRunner::class,47 'star_runner' => StarRunner::class,48 ];49 /**50 * Sets the command instance for running the installer.51 *52 * @param \Illuminate\Console\Command $command53 * @return $this54 */55 public function onCommand(Command $command)56 {57 $this->command = $command;58 return $this;59 }60 /**61 * Run the installer.62 *63 * @return void64 */65 public function run()66 {67 if (! $this->command) {68 throw new \Exception('You must attach a command instance to the installer');69 }70 $this->getRunners()->each(function ($runner) {71 $runner = app()->make($runner);72 $runner->onCommand($this->command);73 $runner->run();74 $runner->after();75 });76 }77 public function getRunners()78 {79 return collect(array_merge(80 $this->runners,81 config('getcandy.installer.runners', [])82 ));83 }84}...

Full Screen

Full Screen

mocks.go

Source:mocks.go Github

copy

Full Screen

...20 ErrChanCb func() error21 ErrChanErr error22 }23 TestRunner struct {24 runnerCfg TestRunnerConfig25 serverCfg *Config26 }27)28func NewTestRunner(trc *TestRunnerConfig, sc *Config) *TestRunner {29 if trc == nil {30 trc = &TestRunnerConfig{}31 }32 return &TestRunner{33 runnerCfg: *trc,34 serverCfg: sc,35 }36}37func (tr *TestRunner) Start(ctx context.Context, errChan chan<- error) error {38 if tr.runnerCfg.StartCb != nil {39 tr.runnerCfg.StartCb()40 }41 if tr.runnerCfg.ErrChanCb == nil {42 tr.runnerCfg.ErrChanCb = func() error {43 return tr.runnerCfg.ErrChanErr44 }45 }46 go func() {47 select {48 case <-ctx.Done():49 case errChan <- tr.runnerCfg.ErrChanCb():50 if tr.runnerCfg.ErrChanErr != nil {51 tr.runnerCfg.Running.SetFalse()52 }53 }54 }()55 if tr.runnerCfg.StartErr == nil {56 tr.runnerCfg.Running.SetTrue()57 }58 return tr.runnerCfg.StartErr59}60func (tr *TestRunner) Signal(sig os.Signal) error {61 if tr.runnerCfg.SignalCb != nil {62 tr.runnerCfg.SignalCb(tr.serverCfg.Index, sig)63 }64 return tr.runnerCfg.SignalErr65}66func (tr *TestRunner) IsRunning() bool {67 return tr.runnerCfg.Running.IsTrue()68}69func (tr *TestRunner) GetLastPid() uint64 {70 return tr.runnerCfg.LastPid71}72func (tr *TestRunner) GetConfig() *Config {73 return tr.serverCfg74}...

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1require_once __DIR__ . '/vendor/atoum/atoum/classes/autoloader.php';2$autoloader = new \mageekguy\atoum\autoloader();3$autoloader->addNamespaceAlias('mageekguy\atoum', __DIR__ . '/vendor/atoum/atoum/classes');4$runner = new \mageekguy\atoum\runner();5$runner->addTestsFromDirectory(__DIR__ . '/tests/units');6$runner->run();7namespace tests\units;8{9 public function test()10 {11 $this->assert->boolean(true)->isTrue();12 }13}

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1require_once 'vendor/autoload.php';2require_once 'vendor/atoum/atoum/classes/autoloader.php';3$script = new \mageekguy\atoum\scripts\runner();4$script->setRootDirectory(__DIR__);5$script->run();6require_once 'vendor/autoload.php';7require_once 'vendor/atoum/atoum/classes/autoloader.php';8$script = new \mageekguy\atoum\scripts\runner();9$script->setRootDirectory(__DIR__);10$script->run();11PHP 1. {main}() /home/.../1.php:012PHP 1. {main}() /home/.../2.php:013require_once 'vendor/autoload.php';14require_once 'vendor/atoum/atoum/classes/autoloader.php';15\atoum\autoloader::register();16$script = new \mageekguy\atoum\scripts\runner();17$script->setRootDirectory(__DIR__);18$script->run();

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1$script->addDefaultReport();2$runner->addTestsFromDirectory('tests/');3$runner->run();4$script->addDefaultReport();5$runner->addTestsFromDirectory('tests/');6$runner->run();7You can use the atoum's configuration file (atoum.yml) to define your tests directory and run all tests in one command:8require_once __DIR__ . '/vendor/autoload.php';9$runner = new atoum\runner();10 ->addTestsFromDirectory(__DIR__ . '/tests/')11 ->run()12;

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1$runner = new \mageekguy\atoum\runner();2$runner->addTestsFromDirectory(__DIR__.'/tests/units');3$runner->run();4use \mageekguy\atoum;5{6 public function testAddition() {7 $this->integer(1)->isEqualTo(1);8 }9}10PHP Fatal error: Call to a member function addTestsFromDirectory() on a non-object in /var/www/1.php on line 311{12 "require-dev": {13 }14}

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1require_once 'path/to/atoum/autoloader.php';2$script->addDefaultReport();3$runner->addTestsFromDirectory('path/to/tests');4$runner->run();5namespace Tests\Units;6use atoum;7{8 public function test1()9 {10 $this->boolean(true)->isTrue();11 }12}

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1require_once 'atoum/autoloader.php';2$script->addTestsFromDirectory('tests/units');3$runner->addTestsFromDirectory('tests/units');4namespace tests\units;5{6 public function testSomething()7 {8 ->if($foo = new \foo())9 ->object($foo)->isInstanceOf('foo')10 ;11 }12}

Full Screen

Full Screen

runner

Using AI Code Generation

copy

Full Screen

1require_once dirname(__FILE__) . '/vendor/autoload.php';2use mageekguy\atoum;3$script = new atoum\scripts\runner();4$script->run();5require_once 'PHPUnit/Autoload.php';6PHPUnit_TextUI_Command::main();7require_once dirname(__FILE__) . '/vendor/autoload.php';8use mageekguy\atoum;9$script = new atoum\scripts\runner();10$script->run();11require_once 'PHPUnit/Autoload.php';12PHPUnit_TextUI_Command::main();13require_once dirname(__FILE__) . '/vendor/autoload.php';14use mageekguy\atoum;15$script = new atoum\scripts\runner();16$script->run();17require_once 'PHPUnit/Autoload.php';18PHPUnit_TextUI_Command::main();19require_once dirname(__FILE__) . '/vendor/autoload.php';20use mageekguy\atoum;21$script = new atoum\scripts\runner();22$script->run();23require_once 'PHPUnit/Autoload.php';24PHPUnit_TextUI_Command::main();25require_once dirname(__FILE__) . '/vendor/autoload.php';26use mageekguy\atoum;27$script = new atoum\scripts\runner();28$script->run();29require_once 'PHPUnit/Autoload.php';30PHPUnit_TextUI_Command::main();31require_once dirname(__FILE__) . '/vendor/autoload.php';32use mageekguy\atoum;33$script = new atoum\scripts\runner();34$script->run();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in runner

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful