Extracted lcdbridge and added first signs of RPI B+ to pi mapper

This commit is contained in:
2014-08-13 03:04:31 +02:00
parent 1449ec643f
commit ec4e5bd6ab
9 changed files with 75 additions and 100 deletions

3
tests/bootstrap.php Normal file
View File

@ -0,0 +1,3 @@
<?php
require_once __DIR__."/../vendor/autoload.php";

34
tests/src/GpioTest.php Normal file
View File

@ -0,0 +1,34 @@
<?php
namespace NoccyLabs\Gpio;
class GpioTest extends \PhpUnit_Framework_TestCase
{
protected $gpio;
public function setup()
{
// dummy gpio
$this->gpio = new Gpio(true);
}
public function testAccessingGpioPins()
{
$pin0 = $this->gpio[0];
$this->assertInstanceOf('NoccyLabs\Gpio\GpioPin', $pin0);
$pin1 = $this->gpio[1];
$this->assertInstanceOf('NoccyLabs\Gpio\GpioPin', $pin1);
$this->assertNotEquals($pin0, $pin1);
}
public function testAccessingGpioPinsViaMapper()
{
$this->gpio->setMapper( new GpioMapper\WiringPiMapper );
$pin0 = $this->gpio[0];
$this->assertInstanceOf('NoccyLabs\Gpio\GpioPin', $pin0);
$pin1 = $this->gpio[1];
$this->assertInstanceOf('NoccyLabs\Gpio\GpioPin', $pin1);
$this->assertNotEquals($pin0, $pin1);
}
}