예제 #1
0
 public function testCreateCredentials()
 {
     $this->jobList->expects($this->once())->method('add')->with('OCA\\UpdateNotification\\ResetTokenBackgroundJob');
     $this->secureRandom->expects($this->once())->method('generate')->with(64)->willReturn('MyGeneratedToken');
     $this->config->expects($this->once())->method('setSystemValue')->with('updater.secret');
     $this->timeFactory->expects($this->once())->method('getTime')->willReturn(12345);
     $this->config->expects($this->once())->method('setAppValue')->with('core', 'updater.secret.created', 12345);
     $expected = new DataResponse('MyGeneratedToken');
     $this->assertEquals($expected, $this->adminController->createCredentials());
 }