Skip to content

Commit 326b254

Browse files
authored
Merge pull request #2541 from yajra/actions
Move tests to github actions.
2 parents 309d034 + ad30f07 commit 326b254

File tree

5 files changed

+51
-24
lines changed

5 files changed

+51
-24
lines changed

.github/workflows/tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
tests:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
php: [7.3, 7.4, 8.0]
18+
stability: [prefer-lowest, prefer-stable]
19+
20+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, memcached
31+
tools: composer:v2
32+
coverage: none
33+
34+
- name: Setup Memcached
35+
uses: niden/actions-memcached@v7
36+
37+
- name: Install dependencies
38+
uses: nick-invision/retry@v1
39+
with:
40+
timeout_minutes: 5
41+
max_attempts: 5
42+
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
43+
44+
- name: Execute tests
45+
run: vendor/bin/phpunit --verbose

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Laravel 4.2|5.x|6|7|8](https://img.shields.io/badge/Laravel-4.2|5.x|6|7|8-orange.svg)](http://laravel.com)
88
[![Latest Stable Version](https://img.shields.io/packagist/v/yajra/laravel-datatables-oracle.svg)](https://packagist.org/packages/yajra/laravel-datatables-oracle)
99
[![Latest Unstable Version](https://poser.pugx.org/yajra/laravel-datatables-oracle/v/unstable.svg)](https://packagist.org/packages/yajra/laravel-datatables-oracle)
10-
[![Build Status](https://travis-ci.org/yajra/laravel-datatables.svg?branch=master)](https://travis-ci.org/yajra/laravel-datatables)
10+
![Build Status](https://github.com/yajra/laravel-datatables-html/workflows/tests/badge.svg)
1111
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yajra/laravel-datatables/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yajra/laravel-datatables/?branch=master)
1212
[![Total Downloads](https://poser.pugx.org/yajra/laravel-datatables-oracle/downloads.png)](https://packagist.org/packages/yajra/laravel-datatables-oracle)
1313
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/yajra/laravel-datatables-oracle)

src/Utilities/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ public static function getOrMethod($method)
157157
*/
158158
public static function convertToArray($row, $filters = [])
159159
{
160-
$row = is_object($row) && method_exists($row, 'makeHidden') ? $row->makeHidden(Arr::get($filters, 'hidden', [])) : $row;
161-
$row = is_object($row) && method_exists($row, 'makeVisible') ? $row->makeVisible(Arr::get($filters, 'visible', [])) : $row;
160+
$row = is_object($row) && method_exists($row, 'makeHidden') ? $row->makeHidden(Arr::get($filters, 'hidden', [])) : $row;
161+
$row = is_object($row) && method_exists($row, 'makeVisible') ? $row->makeVisible(Arr::get($filters, 'visible', [])) : $row;
162162
$data = $row instanceof Arrayable ? $row->toArray() : (array) $row;
163163

164164
foreach ($data as &$value) {

tests/Integration/QueryDataTableTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ public function it_returns_search_panes_options()
243243
'recordsFiltered' => 20,
244244
'searchPanes' => [
245245
'options' => [
246-
'name' => [],
246+
'id' => [],
247247
],
248248
],
249249
]);
250250

251251
$options = $crawler->json()['searchPanes']['options'];
252252

253-
$this->assertEquals(count($options['name']), 20);
253+
$this->assertEquals(count($options['id']), 20);
254254
}
255255

256256
/** @test */
@@ -400,7 +400,7 @@ protected function setUp(): void
400400
$options = User::select('id as value', 'name as label')->get();
401401

402402
return $dataTable->query(DB::table('users'))
403-
->searchPane('name', $options)
403+
->searchPane('id', $options)
404404
->toJson();
405405
});
406406
}

0 commit comments

Comments
 (0)