-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from peter279k/initial_tests
Initial tests
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 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,12 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
indent_style = space | ||
indent_size = 4 |
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,15 @@ | ||
language: php | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
- nightly | ||
|
||
before_script: | ||
- composer install | ||
|
||
script: | ||
- ./vendor/bin/phpunit --coverage-text |
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" colors="true" backupGlobals="false" | ||
backupStaticAttributes="false" syntaxCheck="false"> | ||
<testsuites> | ||
<testsuite name="Tests"> | ||
<directory suffix="Test.php">tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="false"> | ||
<directory suffix=".php">src</directory> | ||
<exclude> | ||
<file>src/autoload.php</file> | ||
</exclude> | ||
</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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace MirazMac\BanglaString; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class BanglaStringTest extends TestCase | ||
{ | ||
protected $banglaStr; | ||
|
||
public function setUp() | ||
{ | ||
$this->banglaStr = new BanglaString('hello'); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
$this->banglaStr = null; | ||
} | ||
|
||
public function testTranslate() | ||
{ | ||
$this->assertInstanceOf('MirazMac\BanglaString\BanglaString', BanglaString::translate('hello')); | ||
} | ||
|
||
public function testToBijoy() | ||
{ | ||
$this->assertEquals('hello', $this->banglaStr->toBijoy('Ahello')); | ||
} | ||
|
||
public function testToAvro() | ||
{ | ||
$this->assertEquals('যবষষড়', $this->banglaStr->toAvro('hello')); | ||
} | ||
|
||
public function testBanglaStringWithInvalidString() | ||
{ | ||
$this->setExpectedException('\InvalidArgumentException'); | ||
$banglaStr = new BanglaString(10); | ||
} | ||
} |