added test and fix
Closed
added test and fix
7 unresolved threads
Closed
requested to merge issue/drupal-3334045:3334045-drupalcoretemplateattribute-doesnt-support into 11.x
7 unresolved threads
Closes #3334045
Merge request reports
Activity
148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses() { 151 // Attempt to add a class without initializing the 'class' attribute. 152 $attribute2 = new Attribute(); changed this line in version 4 of the diff
148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses() { 151 // Attempt to add a class without initializing the 'class' attribute. 152 $attribute2 = new Attribute(); 153 $attribute2['class'][] = 'test-class'; 154 $this->assertEquals(new AttributeArray('class', ['test-class']), $attribute2['class']); 155 151 156 // Add empty Attribute object with no classes. 152 157 $attribute = new Attribute(); 153 158 154 159 // Add no class on empty attribute. 155 160 $attribute->addClass(); 156 $this->assertEmpty($attribute['class']); Because the fix we are adding in this issue, will add the
class
attribute by default.So, this assertion will fail.I have reverted back this line with a small change, as
$attribute['class']->value()
will be empty now.Edited by Yash Rode
added 1 commit
- 61c9bd80 - reverted back the removed line, with a twist
added 76 commits
Toggle commit list148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses(): void { 151 // Add empty Attribute object with no classes. 151 // Attempt to add a class without initializing the 'class' attribute. 152 152 $attribute = new Attribute(); 153 $attribute['class'][] = 'test-class'; 154 $this->assertEquals(new AttributeArray('class', ['test-class']), $attribute['class']); 153 155 156 $attribute2 = new Attribute(); changed this line in version 10 of the diff
148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses(): void { 151 // Add empty Attribute object with no classes. 151 // Attempt to add a class without initializing the 'class' attribute. 152 152 $attribute = new Attribute(); 153 $attribute['class'][] = 'test-class'; 148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses(): void { 151 // Add empty Attribute object with no classes. 151 // Attempt to add a class without initializing the 'class' attribute. 152 152 $attribute = new Attribute(); 153 $attribute['class'][] = 'test-class'; 154 $this->assertEquals(new AttributeArray('class', ['test-class']), $attribute['class']); changed this line in version 9 of the diff
148 148 * @covers ::addClass 149 149 */ 150 150 public function testAddClasses(): void { 151 // Add empty Attribute object with no classes. 151 // Attempt to add a class without initializing the 'class' attribute. changed this line in version 10 of the diff
added 216 commits
-
5cdc07e1...bfce4567 - 206 commits from branch
project:11.x
- e43bd013 - added test and fix
- 0812d178 - Removed assertion in test
- 94aa8da4 - moved data provider -> existing test method
- 576145d9 - test nits
- e55d8bb8 - nit
- 3b6400ae - reverted back the removed line, with a twist
- e88e1b92 - created new att
- 7a5bb766 - Reverted variable rename.
- 17eaac52 - Added detail to comment.
- 4b5a3bf5 - Added comment.
Toggle commit list-
5cdc07e1...bfce4567 - 206 commits from branch
Please register or sign in to reply