Skip to content

Commit e98c9bd

Browse files
authored
Merge pull request #44 from magento-commerce/imported-magento-magento-coding-standard-251
[Imported] AC-956: Create unit test for Magento2\Less\ZeroUnitsSniff check
2 parents 96729ec + a16e77e commit e98c9bd

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

Magento2/Sniffs/Less/ZeroUnitsSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Ensure that units for 0 is not specified
1515
* Omit leading "0"s in values, use dot instead
1616
*
17-
* @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#and-units
17+
* @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#0-and-units
1818
* @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#floating-values
1919
*/
2020
class ZeroUnitsSniff implements Sniff
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// /**
2+
// * Copyright © Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
.my{
7+
border-width: 0px;
8+
margin-left: 0.5rem;
9+
}
10+
11+
.foo {
12+
border-width: 0;
13+
margin-left: .5rem;
14+
}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento2\Tests\Less;
7+
8+
class ZeroUnitsUnitTest extends AbstractLessSniffUnitTestCase
9+
{
10+
/**
11+
* @inheritdoc
12+
*/
13+
public function getErrorList()
14+
{
15+
return [
16+
7 => 1,
17+
8 => 1,
18+
];
19+
}
20+
21+
/**
22+
* @inheritdoc
23+
*/
24+
public function getWarningList()
25+
{
26+
return [];
27+
}
28+
}

0 commit comments

Comments
 (0)