/** * @test */ public function taskFailsOnError() { $GLOBALS['TCA']['pages']['ctrl']['delete'] = 'deleted'; $GLOBALS['TCA']['pages']['ctrl']['tstamp'] = 'tstamp'; $tables = array('pages'); $this->subject->setTcaTables($tables); $period = 14; $this->subject->setPeriod($period); $dbMock = $this->getMock(DatabaseConnection::class); $dbMock->expects($this->once())->method('sql_error')->willReturn(1049); $this->subject->setDatabaseConnection($dbMock); $this->assertFalse($this->subject->execute()); }
/** * @test */ public function getPeriodCanBeSet() { $period = 14; $this->subject->setPeriod($period); $this->assertEquals($period, $this->subject->getPeriod()); }