Update to Drupal 8.0.1. For more information, see https://www.drupal.org/node/2627402
This commit is contained in:
parent
013aaaf2ff
commit
1a0e9d9fac
153 changed files with 1268 additions and 670 deletions
|
@ -83,7 +83,7 @@ class FieldModuleUninstallValidatorTest extends EntityUnitTestBase {
|
|||
}
|
||||
catch (ModuleUninstallValidatorException $e) {
|
||||
$this->pass($message);
|
||||
$this->assertEqual($e->getMessage(), 'The following reasons prevents the modules from being uninstalled: There is data for the field extra_base_field on entity type Test entity');
|
||||
$this->assertEqual($e->getMessage(), 'The following reasons prevent the modules from being uninstalled: There is data for the field extra_base_field on entity type Test entity');
|
||||
}
|
||||
|
||||
// Verify uninstalling entity_test is not possible when there is content for
|
||||
|
|
|
@ -271,13 +271,6 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
$image_truecolor = imageistruecolor($toolkit->getResource());
|
||||
$this->assertTrue($image_truecolor, SafeMarkup::format('Image %file after load is a truecolor image.', array('%file' => $file)));
|
||||
|
||||
if ($image->getToolkit()->getType() == IMAGETYPE_GIF) {
|
||||
if ($op == 'desaturate') {
|
||||
// Transparent GIFs and the imagefilter function don't work together.
|
||||
$values['corners'][3][3] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Store the original GD resource.
|
||||
$old_res = $toolkit->getResource();
|
||||
|
||||
|
@ -330,11 +323,21 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
if ($image->getToolkit()->getType() != IMAGETYPE_JPEG && $image_original_type != IMAGETYPE_JPEG) {
|
||||
// Now check each of the corners to ensure color correctness.
|
||||
foreach ($values['corners'] as $key => $corner) {
|
||||
// The test gif that does not have transparency has yellow where the
|
||||
// others have transparent.
|
||||
if ($file === 'image-test-no-transparency.gif' && $corner === $this->transparent) {
|
||||
$corner = $this->yellow;
|
||||
// The test gif that does not have transparency color set is a
|
||||
// special case.
|
||||
if ($file === 'image-test-no-transparency.gif') {
|
||||
if ($op == 'desaturate') {
|
||||
// For desaturating, keep the expected color from the test
|
||||
// data, but set alpha channel to fully opaque.
|
||||
$corner[3] = 0;
|
||||
}
|
||||
elseif ($corner === $this->transparent) {
|
||||
// Set expected pixel to yellow where the others have
|
||||
// transparent.
|
||||
$corner = $this->yellow;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the location of the corner.
|
||||
switch ($key) {
|
||||
case 0:
|
||||
|
@ -436,9 +439,46 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests loading an image whose transparent color index is out of range.
|
||||
* Tests for GIF images with transparency.
|
||||
*/
|
||||
function testTransparentColorOutOfRange() {
|
||||
function testGifTransparentImages() {
|
||||
// Prepare a directory for test file results.
|
||||
$directory = $this->publicFilesDirectory .'/imagetest';
|
||||
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
|
||||
|
||||
// Test loading an indexed GIF image with transparent color set.
|
||||
// Color at top-right pixel should be fully transparent.
|
||||
$file = 'image-test-transparent-indexed.gif';
|
||||
$image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file);
|
||||
$resource = $image->getToolkit()->getResource();
|
||||
$color_index = imagecolorat($resource, $image->getWidth() - 1, 0);
|
||||
$color = array_values(imagecolorsforindex($resource, $color_index));
|
||||
$this->assertEqual($this->rotateTransparent, $color, "Image {$file} after load has full transparent color at corner 1.");
|
||||
|
||||
// Test deliberately creating a GIF image with no transparent color set.
|
||||
// Color at top-right pixel should be fully transparent while in memory,
|
||||
// fully opaque after flushing image to file.
|
||||
$file = 'image-test-no-transparent-color-set.gif';
|
||||
$file_path = $directory . '/' . $file ;
|
||||
// Create image.
|
||||
$image = $this->imageFactory->get();
|
||||
$image->createNew(50, 20, 'gif', NULL);
|
||||
$resource = $image->getToolkit()->getResource();
|
||||
$color_index = imagecolorat($resource, $image->getWidth() - 1, 0);
|
||||
$color = array_values(imagecolorsforindex($resource, $color_index));
|
||||
$this->assertEqual($this->rotateTransparent, $color, "New GIF image with no transparent color set after creation has full transparent color at corner 1.");
|
||||
// Save image.
|
||||
$this->assertTrue($image->save($file_path), "New GIF image {$file} was saved.");
|
||||
// Reload image.
|
||||
$image_reloaded = $this->imageFactory->get($file_path);
|
||||
$resource = $image_reloaded->getToolkit()->getResource();
|
||||
$color_index = imagecolorat($resource, $image_reloaded->getWidth() - 1, 0);
|
||||
$color = array_values(imagecolorsforindex($resource, $color_index));
|
||||
// Check explicitly for alpha == 0 as the rest of the color has been
|
||||
// compressed and may have slight difference from full white.
|
||||
$this->assertEqual(0, $color[3], "New GIF image {$file} after reload has no transparent color at corner 1.");
|
||||
|
||||
// Test loading an image whose transparent color index is out of range.
|
||||
// This image was generated by taking an initial image with a palette size
|
||||
// of 6 colors, and setting the transparent color index to 6 (one higher
|
||||
// than the largest allowed index), as follows:
|
||||
|
|
|
@ -133,6 +133,15 @@ class RouteProviderTest extends KernelTestBase {
|
|||
$this->assertTrue(array_key_exists('/node', $candidates), 'Seventh candidate found.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't fail when given an empty path.
|
||||
*/
|
||||
public function testEmptyPathCandidatesOutlines() {
|
||||
$provider = new TestRouteProvider(Database::getConnection(), $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
|
||||
$candidates = $provider->getCandidateOutlines([]);
|
||||
$this->assertEqual(count($candidates), 0, 'Empty parts should return no candidates.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirms that we can find routes with the exact incoming path.
|
||||
*/
|
||||
|
|
|
@ -256,7 +256,7 @@ msgid "I have context."
|
|||
msgstr "I HAZ KONTEX."
|
||||
EOF;
|
||||
}
|
||||
else if ($langcode === 'zz') {
|
||||
elseif ($langcode === 'zz') {
|
||||
return <<< EOF
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
namespace Drupal\system\Tests\Update;
|
||||
|
||||
/**
|
||||
* Tests the upgrade path for local actions/tasks being converted into blocks.
|
||||
*
|
||||
* @see https://www.drupal.org/node/507488
|
||||
* Tests the upgrade path for page site variables being converted into a block.
|
||||
*
|
||||
* @group system
|
||||
*/
|
||||
|
|
Reference in a new issue