Skip to content

Commit

Permalink
setup composer and test
Browse files Browse the repository at this point in the history
  • Loading branch information
cordoval committed Apr 27, 2012
1 parent 9fa63dc commit e038a42
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quartus
src/mccalla
vendor
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "computer/build",
"description": "computer generator",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.2"
}
}
10 changes: 10 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php" >

<testsuites>
<testsuite name="ComputerBuild Project">
<directory>src/Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>src</directory>
<exclude>
<!--<directory>src/*/Bundle/*Bundle/Tests</directory>-->
</exclude>
</whitelist>
</filter>

</phpunit>
2 changes: 1 addition & 1 deletion src/ComputerBuild/Vhdl/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function quoted($expression)
{
if ($expression instanceof \string) {
if (strlen($expression) == 1) {
return "'$expression'";
return "'".$expression."'";
} else {
return "\"".$expression."\"";
}
Expand Down
16 changes: 16 additions & 0 deletions src/Tests/ComputerBuild/Vhdl/StatementTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Tests\ComputerBuild\Vhdl;

use ComputerBuild\Vhdl\Statement;

class StatementTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function shouldQuoteStringLengthOfOne()
{
$this->assertEquals("'u'", (new Statement())->quoted('u'));
}
}

0 comments on commit e038a42

Please sign in to comment.