Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ build:
before:
- chmod -R 777 storage
- chmod -R 777 bootstrap/cache
- touch database/database.sqlite
- npm run production
override:
-
Expand Down
78 changes: 42 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
{
"language": "php",
"sudo": false,
"cache": {
"directories": [
"node_modules",
"$HOME/.composer/cache",
"vendor"
]
},
"services": [
"mysql",
"memcached",
"redis-server"
],
"before_install": [
"phpenv config-rm xdebug.ini || true",
"echo \"extension = memcached.so\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini",
"printf \"\\n\" | pecl install -f redis",
"npm install && npm run dev",
"mysql -e 'CREATE DATABASE webshelf;'",
"composer install",
"travis_retry composer self-update",
"php artisan migrate"
],
"install": [
"if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi",
"if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi"
],
"script": "vendor/bin/phpunit",
"global_env": "setup=stable",
"group": "stable",
"dist": "trusty",
"php": 7.1,
"os": "linux"
}
dist: xenial
language: php

env:
global:
- SETUP=stable

matrix:
fast_finish: true
include:
- php: 7.1
- php: 7.1
env: SETUP=lowest
- php: 7.2
- php: 7.2
env: SETUP=lowest
- php: 7.3
- php: 7.3
env: SETUP=lowest

cache:
directories:
- $HOME/.composer/cache

services:
- memcached
- redis-server
- mysql

before_install:
- phpenv config-rm xdebug.ini || true
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- printf "\n" | pecl install -f redis
- travis_retry composer self-update
- touch database/database.sqlite
- mysql -e 'CREATE DATABASE forge;'

install:
- if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
- if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi

script: vendor/bin/phpunit
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"xethron/migrations-generator": "^2.0.1"
"phpunit/phpunit": "^7.0"
},
"autoload": {
"files": [
Expand Down
108 changes: 1 addition & 107 deletions composer.lock

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

3 changes: 0 additions & 3 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@
App\Providers\InstanceServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\ViewServiceProvider::class,

Way\Generators\GeneratorsServiceProvider::class,
Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class,
],

/*
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<testsuite name="Plugins">
<directory suffix="Tests.php">./app/Modules/*/</directory>
</testsuite>

<testsuite name="test">
<directory suffix="Test.php">./tests/*</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
Expand Down
40 changes: 21 additions & 19 deletions tests/Article/ArticleFrontendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function it_should_show_an_article_that_is_published()

$response = $this->get($article->path());

$response->assertSee($article->title)->assertViewIs('articles')->assertOk();
$response->assertSee($article->title)->assertViewIs('articles')->assertStatus(200);
}

/**
Expand All @@ -73,7 +73,7 @@ public function a_collection_of_articles_can_be_viewed_on_the_frontpage_except_u

$response = $this->get('articles');

$response->assertSee($collection->random()->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertOk();
$response->assertSee($collection->random()->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertStatus(200);
}

/**
Expand All @@ -88,7 +88,7 @@ public function a_category_can_have_a_collection_of_articles_on_the_frontpage_ex

$response = $this->get('articles/'.$category->slug);

$response->assertSee($collection->random()->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertOk();
$response->assertSee($collection->random()->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertStatus(200);
}

/**
Expand All @@ -102,7 +102,7 @@ public function articles_can_be_searched_on_the_frontpage()

$response = $this->get('/articles/search?query='.$article->title);

$response->assertSee($article->title)->assertViewIs('articles')->assertOk();
$response->assertSee($article->title)->assertViewIs('articles')->assertStatus(200);
}

/**
Expand All @@ -114,21 +114,23 @@ public function it_should_not_show_unpublished_articles_on_search()

$response = $this->get('/articles/search?query='.$unpublished->title);

$response->assertDontSee($unpublished->title)->assertViewIs('articles')->assertOk();
$response->assertDontSee($unpublished->title)->assertViewIs('articles')->assertStatus(200);
}

// /**
// * @test
// */
// public function view_all_articles_by_creator_on_the_frontpage_except_unpublished()
// {
// $account = factory('App\Model\Account')->create();
//
// $article = factory('App\Model\Article')->create(['creator_id' => $account->id]);
// $unpublished = factory('App\Model\Article')->create(['unpublish_date' => Carbon::now()]);
//
// $response = $this->get('/articles/creator/'.$account->username);
//
// $response->assertSee($article->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertOk();
// }
/**
* @test
*/
public function view_all_articles_by_creator_on_the_frontpage_except_unpublished()
{
$this->markTestSkipped('Cannot query empty instance [App/Model/Categories]');

$account = factory('App\Model\Account')->create();

$article = factory('App\Model\Article')->create(['creator_id' => $account->id]);
$unpublished = factory('App\Model\Article')->create(['unpublish_date' => Carbon::now()]);

$response = $this->get('/articles/creator/'.$account->username);

$response->assertSee($article->title)->assertDontSee($unpublished->title)->assertViewIs('articles')->assertStatus(200);
}
}
2 changes: 1 addition & 1 deletion tests/Products/ProductDashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public function the_modules_are_viewable_on_the_products_index()
$response->assertSee($module['title']);
}

$response->assertOk();
$response->assertStatus(200);
}
}
2 changes: 1 addition & 1 deletion tests/Sitemap/SitemapResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SitemapResponseTest extends TestCase
*/
public function it_creates_a_sitemap()
{
$this->get('/sitemap.xml')->assertHeader('Content-type', 'text/xml; charset=UTF-8')->assertOk();
$this->get('/sitemap.xml')->assertHeader('Content-type', 'text/xml; charset=UTF-8')->assertStatus(200);
}

/**
Expand Down