/**
* Test update checks - invalid Git branch
- * @expectedException Exception
*/
public function testCheckUpdateInvalidGitBranch()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid branch selected for updates/');
ApplicationUtils::checkUpdate('', 'null', 0, true, true, 'unstable');
/**
* Check a unsupported PHP version
- * @expectedException Exception
*/
public function testCheckSupportedPHPVersion51()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Your PHP version is obsolete/');
$this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.1.0'));
/**
* Check another unsupported PHP version
- * @expectedException Exception
*/
public function testCheckSupportedPHPVersion52()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Your PHP version is obsolete/');
$this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.2'));
*/
/**
* Attempt to instantiate a LinkDB whereas the datastore is not writable
- *
- * @expectedException Shaarli\Bookmark\Exception\NotWritableDataStoreException
*/
public function testConstructDatastoreNotWriteable()
{
+ $this->expectException(\Shaarli\Bookmark\Exception\NotWritableDataStoreException::class);
$this->expectExceptionMessageRegExp('#Couldn\'t load data from the data store file "null".*#');
$conf = new ConfigManager('tests/utils/config/configJson');
/**
* Use an invalid date format
- * @expectedException Exception
*/
public function testFilterInvalidDayWithChars()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid date format/');
self::$linkFilter->filter(BookmarkFilter::$FILTER_DAY, 'Rainy day, dream away');
/**
* Use an invalid date format
- * @expectedException Exception
*/
public function testFilterInvalidDayDigits()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid date format/');
self::$linkFilter->filter(BookmarkFilter::$FILTER_DAY, '20');
/**
* Attempt to instantiate a LinkDB whereas the datastore is not writable
- *
- * @expectedException Shaarli\Exceptions\IOException
*/
public function testConstructDatastoreNotWriteable()
{
+ $this->expectException(\Shaarli\Exceptions\IOException::class);
$this->expectExceptionMessageRegExp('/Error accessing "null"/');
new LegacyLinkDB('null/store.db', false, false);
/**
* Use an invalid date format
- * @expectedException Exception
*/
public function testFilterInvalidDayWithChars()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid date format/');
self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away');
/**
* Use an invalid date format
- * @expectedException Exception
*/
public function testFilterInvalidDayDigits()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid date format/');
self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20');
/**
* Test errors in UpdaterUtils::write_updates_file(): empty updates file.
- *
- * @expectedException Exception
*/
public function testWriteEmptyUpdatesFile()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/');
UpdaterUtils::write_updates_file('', array('test'));
/**
* Test errors in UpdaterUtils::write_updates_file(): not writable updates file.
- *
- * @expectedException Exception
*/
public function testWriteUpdatesFileNotWritable()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Unable to write(.*)/');
$updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';
/**
* Attempt to export an invalid link selection
- * @expectedException Exception
*/
public function testFilterAndFormatInvalid()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Invalid export selection/');
$this->netscapeBookmarkUtils->filterAndFormat(
/**
* Test errors in UpdaterUtils::write_updates_file(): empty updates file.
- *
- * @expectedException Exception
*/
public function testWriteEmptyUpdatesFile()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/');
UpdaterUtils::write_updates_file('', array('test'));
/**
* Test errors in UpdaterUtils::write_updates_file(): not writable updates file.
- *
- * @expectedException Exception
*/
public function testWriteUpdatesFileNotWritable()
{
+ $this->expectException(\Exception::class);
$this->expectExceptionMessageRegExp('/Unable to write(.*)/');
$updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';