summaryrefslogtreecommitdiffstats
path: root/core/modules/breakpoint/lib
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/breakpoint/lib')
-rw-r--r--core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php4
-rw-r--r--core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php8
-rw-r--r--core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php6
3 files changed, 9 insertions, 9 deletions
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
index c2426b7..02d6e29 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
@@ -157,7 +157,7 @@ class BreakpointGroup extends ConfigEntityBase implements BreakpointGroupInterfa
*/
public function addBreakpointFromMediaQuery($name, $media_query) {
// Use the existing breakpoint if it exists.
- $breakpoint = entity_load('breakpoint', $this->sourceType . '.' . $this->name . '.' . $name);
+ $breakpoint = Breakpoint::load($this->sourceType . '.' . $this->name . '.' . $name);
if (!$breakpoint) {
// Build a new breakpoint.
$breakpoint = entity_create('breakpoint', array(
@@ -191,7 +191,7 @@ class BreakpointGroup extends ConfigEntityBase implements BreakpointGroupInterfa
public function getBreakpoints() {
if (empty($this->breakpoints)) {
foreach ($this->breakpoint_ids as $breakpoint_id) {
- $breakpoint = breakpoint_load($breakpoint_id);
+ $breakpoint = Breakpoint::load($breakpoint_id);
if ($breakpoint) {
$this->breakpoints[$breakpoint_id] = $breakpoint;
}
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php
index 646100a..a9fcadf 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php
@@ -37,10 +37,10 @@ class BreakpointCRUDTest extends BreakpointTestBase {
$this->verifyBreakpoint($breakpoint);
- // Test breakpoint_load_all
- $all_breakpoints = entity_load_multiple('breakpoint');
+ // Test BreakPoint::loadMultiple().
+ $all_breakpoints = Breakpoint::loadMultiple();
$config_name = $breakpoint->id();
- $this->assertTrue(isset($all_breakpoints[$config_name]), 'breakpoint_load_all: New breakpoint is present when loading all breakpoints.');
+ $this->assertTrue(isset($all_breakpoints[$config_name]), 'New breakpoint is present when loading all breakpoints.');
$this->verifyBreakpoint($breakpoint, $all_breakpoints[$config_name]);
// Update the breakpoint.
@@ -51,6 +51,6 @@ class BreakpointCRUDTest extends BreakpointTestBase {
// Delete the breakpoint.
$breakpoint->delete();
- $this->assertFalse(breakpoint_load($config_name), 'breakpoint_load: Loading a deleted breakpoint returns false.', 'Breakpoints API');
+ $this->assertNull(Breakpoint::load($config_name), 'Loading a deleted breakpoint returns null.', 'Breakpoints API');
}
}
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
index 89d0cc1..aac96c9 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
@@ -38,14 +38,14 @@ abstract class BreakpointTestBase extends WebTestBase {
'multipliers',
);
- // Verify breakpoint_load().
- $compare_breakpoint = is_null($compare_breakpoint) ? breakpoint_load($breakpoint->id()) : $compare_breakpoint;
+ // Verify Breakpoint::load().
+ $compare_breakpoint = is_null($compare_breakpoint) ? Breakpoint::load($breakpoint->id()) : $compare_breakpoint;
foreach ($properties as $property) {
$t_args = array(
'%breakpoint' => $breakpoint->label(),
'%property' => $property,
);
- $this->assertEqual($compare_breakpoint->{$property}, $breakpoint->{$property}, format_string('breakpoint_load: Proper %property for breakpoint %breakpoint.', $t_args), 'Breakpoint API');
+ $this->assertEqual($compare_breakpoint->{$property}, $breakpoint->{$property}, format_string('Proper %property for breakpoint %breakpoint.', $t_args), 'Breakpoint API');
}
}
}