public function testRun() { $application = $this->getMockBuilder(ConsoleApplication::class)->setMethods(['run', 'add'])->getMock(); $application->expects($this->once())->method('run'); $application->expects($this->once())->method('add')->with(new Hello()); $this->configuration->expects($this->once())->method('apply')->with($this->injector); $this->injector->expects($this->exactly(2))->method('make')->will($this->onConsecutiveCalls($application, new Hello())); $this->commands->expects($this->any())->method('toArray')->willReturn([Hello::class]); Application::build($this->injector, $this->configuration, $this->commands)->run(); }