-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed project name to Melody, added composer file, etc
- Loading branch information
1 parent
1c320e7
commit ca7de19
Showing
6 changed files
with
59 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.buildpath | ||
.project | ||
.settings/ | ||
.metadata | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
index.php | ||
codecoverage/ |
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,21 @@ | ||
{ | ||
"name": "leviferreira\/melody-validation", | ||
"description": "PHP's DateTime extension", | ||
"type": "library", | ||
"license": "BSD Style", | ||
"homepage": "https://github.com/leviferreira/melody-datetime", | ||
"require": { | ||
"php": ">=5.3.3" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Levi Ferreira", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"autoload": { | ||
"psr-0": { | ||
"Melody\\DateTime": "src\/" | ||
} | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace Datetime; | ||
namespace Melody\Datetime; | ||
|
||
/** | ||
* DateTime extension class to add the function: addBussinessDays in PHP's Default DateTime Class | ||
* DateTime extension class to add the function: addBussinessDays | ||
* and addBusinessDaysWithHolydays in PHP's Default DateTime Class | ||
* | ||
* @author Levi Henrique <[email protected]> | ||
*/ | ||
|
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,5 @@ | ||
<?php | ||
|
||
$loader = require __DIR__.'/../vendor/autoload.php'; | ||
|
||
$loader->add('Melody\DateTime', "src/"); |
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,18 @@ | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="bootstrap.php" | ||
cacheTokens="true" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
verbose="false"> | ||
<filter> | ||
<whitelist> | ||
<directory>../src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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,24 +1,22 @@ | ||
<?php | ||
namespace Test; | ||
|
||
require __DIR__.'/../Datetime/Datetime.php'; | ||
|
||
use Datetime\Datetime; | ||
use Melody\DateTime\DateTime; | ||
|
||
/** | ||
* Testing class DateTimeTest to test DateTime Extension Class | ||
* | ||
* @author Levi Henrique <[email protected]> | ||
*/ | ||
class DatetimeTest extends \PHPUnit_Framework_TestCase { | ||
class DateTimeTest extends \PHPUnit_Framework_TestCase { | ||
|
||
|
||
/** | ||
* @dataProvider provider | ||
*/ | ||
public function testAddBusinessDays($start, $businessDays, $expectedResult) | ||
{ | ||
$date = new Datetime($start); | ||
$date = new DateTime($start); | ||
$date->addBusinessDays($businessDays); | ||
$result = $date->format('Y-m-d'); | ||
$this->assertEquals($expectedResult, $result); | ||
|