parent
1449ec643f
commit
ec4e5bd6ab
@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
NoccyLabs\LcdBridge\LcdBridgeApplication::main();
|
||||
|
||||
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\LcdBridge;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class DaemonCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName("daemon")
|
||||
->setDescription("Spawn a new daemon")
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\LcdBridge;
|
||||
|
||||
use Symfony\Component\Console\Application as ConsoleApplication;
|
||||
|
||||
class LcdBridgeApplication extends ConsoleApplication
|
||||
{
|
||||
public static function main()
|
||||
{
|
||||
$app = new self("lcdbridge", "0.1");
|
||||
|
||||
$app->add( new DaemonCommand );
|
||||
|
||||
$app->run();
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\LinuxGpio;
|
||||
|
||||
class InterruptHandler
|
||||
{
|
||||
public function setInterrupt(Gpio $pin, $edge = null, callable $handler = null)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
<phpunit bootstrap="tests/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="linux-gpio">
|
||||
<directory suffix="Test.php">tests/src/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue