Skip to content

Commit

Permalink
fixed readme layout and added start of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoryduckworth committed Aug 26, 2015
1 parent f504986 commit 4bac26a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
composer.lock
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: php

php:
- 5.5
- 5.6
- 7.0
- hhvm

script: phpunit

before_script:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-dist
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Friendable v0.1
[![Build Status](https://api.travis-ci.org/gregoryduckworth/friendable.png?branch=master)](https://api.travis-ci.org/gregoryduckworth/friendable)
[![PHP version](https://badge.fury.io/ph/gregoryduckworth%2Ffriendable.svg)](http://badge.fury.io/ph/gregoryduckworth%2Ffriendable)

Add the possibility of friends quickly with the use of this trait.

Expand All @@ -11,12 +13,13 @@ $ composer require gregoryduckworth/friendable
```
And then include the service providero within `config/app.php`

``` php
```php
'providers' => [
...
GregoryDuckworth\Friendable\FriendableServiceProvider::class,
...
];
```

At lastly you need to publish and run the migration.

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

<phpunit
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Friendable Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
37 changes: 37 additions & 0 deletions tests/FriendableTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* Gather the appropriate trait
*/
class TestingTraitStub
{
use GregoryDuckworth\Friendable\Traits\Friendable;
}

/**
*
*/
class TraitFriendableTest extends PHPUnit_Framework_TestCase
{
// Trait within test scope
public $trait;

/**
* Setup the trait
*/
public function setUp()
{
$this->trait = new TestingTraitStub;
}

/**
* Check that the trait is in use
*/
public function testTraitUsable()
{
$traits = class_uses($this->trait);

$this->assertContains('GregoryDuckworth\Friendable\Traits\Friendable', $traits);
}

}

0 comments on commit 4bac26a

Please sign in to comment.