diff -u b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php --- b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php +++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php @@ -302,22 +302,6 @@ } /** - * @param string $uuid - */ - public function setUuid($uuid) - { - $this->uuid = $uuid; - } - - /** - * @return string - */ - public function getUuid() - { - return $this->uuid; - } - - /** * @param string $sourceType */ public function setSourceType($sourceType) @@ -398,22 +382,6 @@ } /** - * @param string $langcode - */ - public function setLangcode($langcode) - { - $this->langcode = $langcode; - } - - /** - * @return string - */ - public function getLangcode() - { - return $this->langcode; - } - - /** * @param string $label */ public function setLabel($label) @@ -430,18 +398,2 @@ } - - /** - * @param string $id - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * @return string - */ - public function getId() - { - return $this->id; - } } only in patch2: unchanged: --- /dev/null +++ b/core/modules/breakpoint/tests/Drupal/breakpoint/Tests/BreakpointAPITest.php @@ -0,0 +1,51 @@ + 'Breakpoint API tests', + 'description' => 'Test validation of class properties.', + 'group' => 'Breakpoint', + ); + } + + /** + * Test property setters and getters. + */ + public function testProperties() { + $breakpoint = new Breakpoint( array(), 'Breakpoint'); + + // Properties to test with some random data. + // i.e setLabel($randomdata) and getLabel() + $properties = array( + 'Label' => $this->getRandomGenerator()->name(16), + 'MediaQuery' => $this->getRandomGenerator()->string(16), + 'Multipliers' => array($this->getRandomGenerator()->string(16),$this->getRandomGenerator()->string(16)), + 'Name' => $this->getRandomGenerator()->name(16), + 'Source' => $this->getRandomGenerator()->name(16), + 'SourceType' => $this->getRandomGenerator()->name(16), + 'Weight' => mt_rand(-40, 40), + ); + + foreach($properties as $name => $value) { + $breakpoint->{'set'.$name}($value); + $this->assertEquals($value, $breakpoint->{'get'.$name}(), 'breakpoint_property: set'. $name .' and get'. $name); + } + } +}