Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / tests / SecurityUpdatesTest.php
1 <?php
2
3 namespace Unish;
4
5 /**
6  * Tests "pm:security" commands for D8+.
7  * @group commands
8  * @group slow
9  * @group pm
10  */
11 class SecurityUpdatesTest extends CommandUnishTestCase
12 {
13
14   /**
15    * Test that insecure packages are correctly identified.
16    */
17     public function testInsecurePackage()
18     {
19         $this->drush('pm:security', [], ['format' => 'json'], null, null, self::EXIT_ERROR);
20         $this->assertContains('One or more of your dependencies has an outstanding security update. Please apply update(s) immediately.', $this->getErrorOutput());
21         $this->assertContains('Try running: composer require drupal/alinks:^1.1 --update-with-dependencies', $this->getErrorOutput());
22         $security_advisories = $this->getOutputFromJSON();
23         $this->assertObjectHasAttribute('drupal/alinks', $security_advisories);
24         $this->assertEquals('drupal/alinks', $security_advisories->{"drupal/alinks"}->name);
25         $this->assertEquals('1.0.0', $security_advisories->{"drupal/alinks"}->version);
26         $this->assertEquals('1.1', $security_advisories->{"drupal/alinks"}->{"min-version"});
27     }
28 }