Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
7e240334
Commit
7e240334
authored
Mar 19, 2015
by
Alex Pott
Browse files
Issue
#2443663
by daffie, vlad.n: PostgreSQL: Fix system\Tests\Entity\EntityDefinitionUpdateTest
parent
8e54eca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php
View file @
7e240334
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\system\Tests\Entity
;
use
Drupal\Core\Database\DatabaseExceptionWrapper
;
use
Drupal\Core\Database\IntegrityConstraintViolationException
;
use
Drupal\Core\Entity\EntityStorageException
;
use
Drupal\Core\Entity\EntityTypeEvents
;
use
Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
;
...
...
@@ -359,14 +360,19 @@ public function testBundleFieldCreateDeleteWithExistingEntities() {
->
execute
();
$this
->
fail
(
$message
);
}
catch
(
DatabaseExceptionWrapper
$e
)
{
// Now provide a value for the 'not null' column. This is expected to
// succeed.
$values
[
'new_bundle_field_shape'
]
=
$this
->
randomString
();
$this
->
database
->
insert
(
'entity_test_update__new_bundle_field'
)
->
fields
(
$values
)
->
execute
();
$this
->
pass
(
$message
);
catch
(
\
RuntimeException
$e
)
{
if
(
$e
instanceof
DatabaseExceptionWrapper
||
$e
instanceof
IntegrityConstraintViolationException
)
{
// Now provide a value for the 'not null' column. This is expected to
// succeed.
$values
[
'new_bundle_field_shape'
]
=
$this
->
randomString
();
$this
->
database
->
insert
(
'entity_test_update__new_bundle_field'
)
->
fields
(
$values
)
->
execute
();
$this
->
pass
(
$message
);
}
else
{
// Keep throwing it.
throw
$e
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment