Extracted lcdbridge and added first signs of RPI B+ to pi mapper
This commit is contained in:
3
tests/bootstrap.php
Normal file
3
tests/bootstrap.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
34
tests/src/GpioTest.php
Normal file
34
tests/src/GpioTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user