public function testRegisterAndInitApplication() { $this->application->expects($this->once())->method('getName')->will($this->returnValue('foo')); $this->application->expects($this->once())->method('buildContainer'); $this->application->expects($this->once())->method('init'); $repository = new ApplicationRepository($this->dispatcher); $repository->register($this->application); $this->assertSame($this->application, $repository->get('foo')); $this->assertSame(array('foo' => $this->application), $repository->getArray()); $repository->init(); }