diff --git a/VERSIONS_HOTLINE/131892 b/VERSIONS_HOTLINE/131892 new file mode 100644 index 0000000000000000000000000000000000000000..5412652da6fc12788ee63c7aea9b906b7a188a2b --- /dev/null +++ b/VERSIONS_HOTLINE/131892 @@ -0,0 +1 @@ + - ticket #131892 : Administration : Correction du composant de recherche de paniers dans les configurations de boites \ No newline at end of file diff --git a/public/admin/js/treeselect/test.js b/public/admin/js/treeselect/test.js new file mode 100644 index 0000000000000000000000000000000000000000..5438b63b59d375de35e080e362e7bc26f9eb7673 --- /dev/null +++ b/public/admin/js/treeselect/test.js @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +QUnit.module('treeselect'); + +var datas = [{ + "id": "paniers_by_users", + "label": "Paniers", + "categories": { + "1020": { + "id": "cart-owner-id-1020", + "label": "Administrateur", + "categories": [], + "items": [ + { + "id": 111, + "label": "201111-jeunesse", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 112, + "label": "201111-ados", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 113, + "label": "201111-adultes", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 114, + "label": "201222-jeunesse", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 115, + "label": "201222-ados", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 116, + "label": "201222-adultes", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + }, + { + "id": 117, + "label": "201222-cdc", + "options": { + "ico": "/public/admin/images/picto/paniers_16.png" + } + } + ], + "options": { + "ico": "/public/admin/images/picto/abonnes.gif", + "removeCheckbox": true + } + } + }, + "items": [], + "options": { + "multipleSelection": false + } +}]; + +function pack_ids(ids) { + return $.map(ids, function(d) { return d.id; }).join('-'); +}; + +function call_treeselect() { + $('.treeselect.id_catalogue') + .treeselect({ datas: datas }) + .treeselect('selectItems', []) + .treeselect('selectCategories', []) + .treeselect('toggleVisibility', true) + .treeselect('disableMultipleSelection'); + + $("form").submit(function() { + $(".treeselect").each(function(index) { + var node = $(this); + node.treeselect("readSelection", + function(items, categories) { + node.siblings("input:hidden:nth-child(2)").val(pack_ids(categories)); + node.siblings("input:hidden:nth-child(3)").val(pack_ids(items)); + }); + }); + }); +}; + +function init_and_search(value) { + call_treeselect(); + $('.ui-treeselect-search').find('input[type=textfield]').val(value); + $('.ui-treeselect-search').find('input[type=textfield]').trigger($.Event('keyup', { keyCode: 0 })); + return $('.ui-treeselect-category').find('li:visible'); +} + + +test('Search "biq" will display no item', function() { + var visibles = init_and_search('biq'); + equal(visibles.length, 0); +}); + +test('Search "2011" will display 3 items', function() { + var visibles = init_and_search('2011'); + equal(visibles.length, 3); + equal(visibles[0].textContent, '201111-jeunesse'); + equal(visibles[1].textContent, '201111-ados'); + equal(visibles[2].textContent, '201111-adultes'); +}); + +test('Search "2012" will display 4 items', function() { + var visibles = init_and_search('2012'); + equal(visibles.length, 4); + equal(visibles[0].textContent, '201222-jeunesse'); + equal(visibles[1].textContent, '201222-ados'); + equal(visibles[2].textContent, '201222-adultes'); + equal(visibles[3].textContent, '201222-cdc'); +}); + +test('Search "ados" will display 2 items', function() { + var visibles = init_and_search('ados'); + equal(visibles.length, 2); + equal(visibles[0].textContent, '201111-ados'); + equal(visibles[1].textContent, '201222-ados'); +}); + +test('Search"cdc" will display 1 item', function() { + var visibles = init_and_search('cdc'); + equal(visibles.length, 1); + equal(visibles[0].textContent, '201222-cdc'); +}); diff --git a/public/admin/js/treeselect/tests.html b/public/admin/js/treeselect/tests.html new file mode 100644 index 0000000000000000000000000000000000000000..211cc287df9c62143ee07987348e23bfee04f9e7 --- /dev/null +++ b/public/admin/js/treeselect/tests.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<!-- +/** + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + --> + +<html> +<head> + <meta charset="utf-8"> + <title>QUnit tests</title> + <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-git.css"> +</head> +<body> + <div id="qunit"></div> + <div id="qunit-fixture"></div> + <script type="text/javascript" src="../jquery-3.2.1.min.js"></script> + <script type="text/javascript" src="../jquery-ui-1.12.1/jquery-ui.min.js"></script> + <script src="treeselect.js"></script> + <script src="http://code.jquery.com/qunit/qunit-1.13.0.js"></script> + <script src="test.js"></script> + <form> + <div class="treeselect id_catalogue ui-widget ui-helper-reset"></div> + </form> +</body> +</html> diff --git a/public/admin/js/treeselect/treeselect.js b/public/admin/js/treeselect/treeselect.js index 0c88d923e4500312ca041e273e1a9842fa4120d9..dea80b5d5b02af1925afae95573e3c27ce5ede62 100644 --- a/public/admin/js/treeselect/treeselect.js +++ b/public/admin/js/treeselect/treeselect.js @@ -467,27 +467,26 @@ return; } - accentsTidy = function(s){ - var r=s.toLowerCase(); - r = r.replace(new RegExp("[à áâãäå]", 'g'),"a"); - r = r.replace(new RegExp("æ", 'g'),"ae"); - r = r.replace(new RegExp("ç", 'g'),"c"); - r = r.replace(new RegExp("[èéêë]", 'g'),"e"); - r = r.replace(new RegExp("[ìÃîï]", 'g'),"i"); - r = r.replace(new RegExp("ñ", 'g'),"n"); - r = r.replace(new RegExp("[òóôõö]", 'g'),"o"); - r = r.replace(new RegExp("Å“", 'g'),"oe"); - r = r.replace(new RegExp("[ùúûü]", 'g'),"u"); - r = r.replace(new RegExp("[ýÿ]", 'g'),"y"); - return r; + accentsTidy = function (s) { + var r = s.toLowerCase(); + r = r.replace(new RegExp("[à áâãäå]", 'g'), "a"); + r = r.replace(new RegExp("æ", 'g'), "ae"); + r = r.replace(new RegExp("ç", 'g'), "c"); + r = r.replace(new RegExp("[èéêë]", 'g'), "e"); + r = r.replace(new RegExp("[ìÃîï]", 'g'), "i"); + r = r.replace(new RegExp("ñ", 'g'), "n"); + r = r.replace(new RegExp("[òóôõö]", 'g'), "o"); + r = r.replace(new RegExp("Å“", 'g'), "oe"); + r = r.replace(new RegExp("[ùúûü]", 'g'), "u"); + return r.replace(new RegExp("[ýÿ]", 'g'), "y"); }; searchText = accentsTidy(searchText); - var re = new RegExp('\\b' + searchText, 'gi'); var matches = this.itemsTree.find('li, h3').filter(function() { - return re.test(accentsTidy($(this).text())); + return accentsTidy($(this).text()).indexOf(searchText) > -1; }); + this._highlightItems(matches); matches.parents(".ui-accordion-content").show(); }, diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0dc28b4a65bd7066df080657076a8c35cd5f0d22..407f3f5c34999ea99d38fa93a436357102fa2708 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -96,6 +96,7 @@ require_once 'tests/library/Class/WebService/SIGB/TestingService.php'; require_once 'tests/fixtures/RessourcesNumeriquesFixtures.php'; require_once 'tests/fixtures/MockedClasses.php'; require_once 'tests/application/modules/telephone/controllers/TelephoneAbstractControllerTestCase.php'; +require_once 'tests/js/PhantomJsTest.php'; register_shutdown_function(function(){ TestSpeedTrap::printSpeedTrappedTests(); diff --git a/tests/js/AuthorityPickerTest.php b/tests/js/AuthorityPickerTest.php index dd04f7b40995dd20c3c1e03966496b929c11913b..cc25800058e5583f5fb1b2e3d5eb952522e44dc1 100644 --- a/tests/js/AuthorityPickerTest.php +++ b/tests/js/AuthorityPickerTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,12 +20,6 @@ */ -class AuthorityPickerTest extends PHPUnit_Framework_TestCase { - - /** @test */ - public function searchInputJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/js/authority_picker/tests.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } +class AuthorityPickerTest extends PhantomJsTest { + protected $_test_path = 'public/opac/js/authority_picker/tests.html'; } -?> \ No newline at end of file diff --git a/tests/js/CustomFieldsReportTest.php b/tests/js/CustomFieldsReportTest.php index a4ccd327ec9ceebbf605c2d0852bd421eb5eabbb..3fa7a9c0fc1e9f56accf643e3757cf0456a1a596 100644 --- a/tests/js/CustomFieldsReportTest.php +++ b/tests/js/CustomFieldsReportTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -16,15 +16,10 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class CustomFieldsReportTest extends PHPUnit_Framework_TestCase { - /** @test */ - public function customFieldsReportMethodsJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/admin/js/custom-fields/tests/custom_fields.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } +class CustomFieldsReportTest extends PhantomJsTest { + protected $_test_path = 'public/admin/js/custom-fields/tests/custom_fields.html'; } -?> \ No newline at end of file diff --git a/tests/js/MultiInputTest.php b/tests/js/MultiInputTest.php index c8e31d7df2efc6b384e58f8c6f1834ad68a53974..266f248414a61d75f19f3150b4a53d0e15d9e334 100644 --- a/tests/js/MultiInputTest.php +++ b/tests/js/MultiInputTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,11 +20,6 @@ */ -class MultiInputTest extends PHPUnit_Framework_TestCase { - - /** @test */ - public function multiInputJstestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/admin/js/multi_inputs/tests.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } -} \ No newline at end of file +class MultiInputTest extends PhantomJsTest { + protected $_test_path = 'public/admin/js/multi_inputs/tests.html'; +} diff --git a/tests/js/MultiSelectionTest.php b/tests/js/MultiSelectionTest.php index cff8067164ae26bc9707056f9912e4bd3f9263e7..a6f29fa10758c4accf53ca0575cab33f0087768d 100644 --- a/tests/js/MultiSelectionTest.php +++ b/tests/js/MultiSelectionTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,11 +20,6 @@ */ -class MultiSelectionTest extends PHPUnit_Framework_TestCase { - - /** @test */ - public function multiSelectJstestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/admin/js/multi_selection/tests.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } -} \ No newline at end of file +class MultiSelectionTest extends PhantomJsTest { + protected $_test_path = 'public/admin/js/multi_selection/tests.html'; +} diff --git a/tests/js/PhantomJsTest.php b/tests/js/PhantomJsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0e2d3aa492867d7fd698ee33ad974bfa02fd9c4f --- /dev/null +++ b/tests/js/PhantomJsTest.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +abstract class PhantomJsTest extends PHPUnit_Framework_TestCase { + /** array or string */ + protected $_test_path; + + + public function testPaths() { + if (!$this->_test_path) + return []; + + if (!is_array($this->_test_path)) + $this->_test_path = [$this->_test_path]; + + return array_map(function($path) { return [$path]; }, + $this->_test_path); + } + + + /** + * @test + * @dataProvider testPaths + **/ + public function jsTestShouldSucceed($path) { + exec('phantomjs ' + . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' + . escapeshellarg(ROOT_PATH . $path), + $output, + $result); + + $this->assertEquals(0, $result, implode("\n", $output)); + } +} diff --git a/tests/js/SearchAutocompleteTest.php b/tests/js/SearchAutocompleteTest.php index 3266e81964eee94bd22194d268c49bc26c3e7b77..9d0e69a1a95527848d75b41ed1f068b002617346 100644 --- a/tests/js/SearchAutocompleteTest.php +++ b/tests/js/SearchAutocompleteTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -16,17 +16,10 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class SearchAutocomplete extends PHPUnit_Framework_TestCase { - - - /** @test */ - public function searchAutocompleteJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/java/search_autocomplete/tests/search_autocomplete.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } +class SearchAutocomplete extends PhantomJsTest { + protected $_test_path = 'public/opac/java/search_autocomplete/tests/search_autocomplete.html'; } -?> \ No newline at end of file diff --git a/tests/js/SearchInputTest.php b/tests/js/SearchInputTest.php index d843ee3f83b0e23ece8c26f3bcc3ac7a96c957dc..45046b64b8a5f7f8c6a91117496f7cfe1df38bb7 100644 --- a/tests/js/SearchInputTest.php +++ b/tests/js/SearchInputTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,12 +20,6 @@ */ -class SearchInputTest extends PHPUnit_Framework_TestCase { - - /** @test */ - public function searchInputJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/java/search_input/tests/search_input.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } +class SearchInputTest extends PhantomJsTest { + protected $_test_path = 'public/opac/java/search_input/tests/search_input.html'; } -?> \ No newline at end of file diff --git a/tests/js/SliderNavigationTest.php b/tests/js/SliderNavigationTest.php index 1abb79c512e1b28005ea00649127636605627091..624bfb5f931b17e714ec4bacc3b38f041532a064 100644 --- a/tests/js/SliderNavigationTest.php +++ b/tests/js/SliderNavigationTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,26 +20,8 @@ */ -class SliderNavigationTest extends PHPUnit_Framework_TestCase { - - /** @test */ - public function newsSliderJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/java/slider_navigation/tests/news_slider.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } - - - /** @test */ - public function agendaSliderJStestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/java/slider_navigation/tests/agenda_slider.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } - - - /** @test */ - public function sliderWithPreviewJSTestShouldSucced() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/java/slider_navigation/tests/preview_slider.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } +class SliderNavigationTest extends PhantomJsTest { + protected $_test_path = ['public/opac/java/slider_navigation/tests/news_slider.html', + 'public/opac/java/slider_navigation/tests/agenda_slider.html', + 'public/opac/java/slider_navigation/tests/preview_slider.html']; } -?> \ No newline at end of file diff --git a/tests/js/TreeSelectTest.php b/tests/js/TreeSelectTest.php new file mode 100644 index 0000000000000000000000000000000000000000..849c3c587327884c080166c6ca0ac0fb5901c42c --- /dev/null +++ b/tests/js/TreeSelectTest.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class TreeSelectTest extends PhantomJsTest { + protected $_test_path = 'public/admin/js/treeselect/tests.html'; +} diff --git a/tests/js/UserSelectionTest.php b/tests/js/UserSelectionTest.php index fcf8d79a4dba3acad01195606d0a8f17da050283..35a7fabd01152bd27330c2aa800c4f042f0684b3 100644 --- a/tests/js/UserSelectionTest.php +++ b/tests/js/UserSelectionTest.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved. * * BOKEH is free software; you can redistribute it and/or modify * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by @@ -20,10 +20,6 @@ */ -class UserSelectionTest extends PHPUnit_Framework_TestCase { - /** @test */ - public function userSelectionTestShouldSuccess() { - exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/admin/js/user_selection/tests.html', $output, $result); - $this->assertEquals(0, $result, implode("\n", $output)); - } -} \ No newline at end of file +class UserSelectionTest extends PhantomJsTest { + protected $_test_path = 'public/admin/js/user_selection/tests.html'; +}