This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🐛 Fix the PR cover checker when there is no test (#189) This fixes an issue that is workflow failure when the pull request does not contain tests and Added hotfix branch filter to check tests * fix(helper): 🐛 fixed float to int convertion * feat(bin): ✨ new command sync with container * build: 📦 new patch version of mercardo pago for magento 2 v3.12.3 Co-authored-by: Gustavo Brito <[email protected]> Co-authored-by: Douglas <[email protected]>
- Loading branch information
1 parent
ee07903
commit b34ce87
Showing
13 changed files
with
228 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ indent_size = 2 | |
|
||
[{composer, auth}.json] | ||
indent_size = 4 | ||
|
||
[{Makefile,**.mk}] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
#!/bin/bash | ||
|
||
echo "Getting pull request head branch..." | ||
export PHPUNIT_HEAD_BRANCH=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/PluginAndPartners/cart-magento2/pulls/${PR_NUMBER} \ | ||
| jq ".head.ref" \ | ||
| xargs) | ||
|
||
echo "Getting pull request files..." | ||
export PHPUNIT_FILES=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/PluginAndPartners/cart-magento2/pulls/${PR_NUMBER}/files \ | ||
| jq ".[].filename" \ | ||
| grep -E 'php"$' \ | ||
| xargs) | ||
|
||
php magento2/app/code/MercadoPago/Test/pull-request-coverage-checker.php clover.xml 40 $PHPUNIT_FILES | ||
php magento2/app/code/MercadoPago/Test/pull-request-coverage-checker.php clover.xml 40 $PHPUNIT_HEAD_BRANCH $PHPUNIT_FILES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
sh bin/run-sync-files.sh | ||
sh bin/run-phpcs.sh | ||
sh bin/run-phpstan.sh | ||
sh bin/run-phpmd.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!bin/bash | ||
echo "\n" | ||
echo 🐘🔍 '\033[01;33m RUNNING SYNC FILES TO MAGENTO 2 CONTAINER \033[0m' | ||
echo "\n" | ||
|
||
docker cp src/. magento-php:/var/www/html/magento2/app/code | ||
|
||
if [ $? -eq 0 ]; then | ||
echo ✅ "\033[01;32m SYNC EXECUTED SUCCESSFULLY \n \033[0m" | ||
else | ||
echo 🚫 "\033[01;31m SYNC FAILED \n \033[0m" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
namespace MercadoPago\Test\Unit\Helper; | ||
|
||
use Magento\Framework\View\Element\Template\Context; | ||
use Magento\Sales\Model\OrderFactory; | ||
use \MercadoPago\Core\Block\Info; | ||
use MercadoPago\Core\Helper\Round; | ||
use \PHPUnit\Framework\TestCase; | ||
|
||
class HelperTest extends TestCase | ||
{ | ||
|
||
public function testRoundIntToUp() | ||
{ | ||
$result = Round::roundInteger(1.9); | ||
$this->assertEquals(2, $result); | ||
|
||
$result = Round::roundInteger(1.5); | ||
$this->assertEquals(2, $result); | ||
} | ||
|
||
public function testRoundIntToDown() | ||
{ | ||
$result = Round::roundInteger(1.4); | ||
$this->assertEquals(1, $result); | ||
|
||
$result = Round::roundInteger(1.1); | ||
$this->assertEquals(1, $result); | ||
} | ||
|
||
public function testRoundFloatToUp() | ||
{ | ||
$result = Round::roundWithoutSiteId(99.4999); | ||
$this->assertEquals(99.5, $result); | ||
|
||
$result = Round::roundWithoutSiteId(55.999); | ||
$this->assertEquals(56, $result); | ||
} | ||
|
||
public function testRoundFloatToDown() | ||
{ | ||
$result = Round::roundWithoutSiteId(66.404444); | ||
$this->assertEquals(66.40, $result); | ||
|
||
$result = Round::roundWithoutSiteId(75.890000); | ||
$this->assertEquals(75.89, $result); | ||
} | ||
|
||
public function testRoundWithSiteFloatToUp() | ||
{ | ||
$result = Round::roundWithSiteId(142.87777, 'MLB'); | ||
$this->assertEquals(142.88, $result); | ||
|
||
$result = Round::roundWithSiteId(545.999, 'MLA'); | ||
$this->assertEquals(546, $result); | ||
} | ||
|
||
public function testRoundWithSiteFloatToDown() | ||
{ | ||
$result = Round::roundWithSiteId(66.672333, 'MLM'); | ||
$this->assertEquals(66.67, $result); | ||
|
||
$result = Round::roundWithSiteId(755.890000, 'MLU'); | ||
$this->assertEquals(755.89, $result); | ||
} | ||
|
||
public function testRoundWithSiteIntToUp() | ||
{ | ||
$result = Round::roundWithSiteId(142.87777, 'MLC'); | ||
$this->assertEquals(143, $result); | ||
|
||
$result = Round::roundWithSiteId(545.999, 'MCO'); | ||
$this->assertEquals(546, $result); | ||
} | ||
|
||
public function testRoundWithSiteIntToDown() | ||
{ | ||
$result = Round::roundWithSiteId(66.472333, 'MCO'); | ||
$this->assertEquals(66, $result); | ||
|
||
$result = Round::roundWithSiteId(755.190000, 'MLC'); | ||
$this->assertEquals(755, $result); | ||
} | ||
|
||
}//end class |
Oops, something went wrong.