Commit graph

65 commits

Author SHA1 Message Date
Katrin Fischer
3c09fefb1d Bug 17469: Add missing sample notices fr-CA test
Add fr-CA installer to xt/sample_letter.t

To test:
- Verify xt/sample_letter.t test checks fr-CA now and
  fails for just fr-CA.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Caitlin Goodger <caitlingoodger.student@wegc.school.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-19 13:39:10 +00:00
Tomas Cohen Arazi
cc4d9822a1 Bug 16174: (QA followup) Fix remaining tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 19:11:33 +00:00
Tomas Cohen Arazi
5c3a58e208 Bug 16174: icondirectories.t broken due to bug 15527
This patch fixes it.

To test:
- Run
  $ prove xt/author/icondirectories.t
=> FAIL: Tests fail:
   Failed test 'opac_icon_directory: koha-tmpl/opac-tmpl/xslt/itemtypeimg exists'
- Apply the patch
- Run
  $ prove xt/author/icondirectories.t
=> SUCCESS: Tests pass and don't raise warnings.
- Sign off

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 19:11:33 +00:00
Tomas Cohen Arazi
b6cd9ab896 Bug 16174: Warning in tt_valid.t due to bug 15527
Bug 15527 introduced a new directory (xslt) on the top level OPAC templates
directory. The tt_valid.t script should include that top level dir on the list
of excluded dirs so it doesn't look for themes there.

To test:
- Run
  $ prove xt/tt_valid.t
=> FAIL: You get the following warning:
Can't stat koha-tmpl/opac-tmpl/xslt/en: No such file or directory
 at xt/tt_valid.t line 8
- Apply the patch
- Run
  $ prove xt/tt_valid.t
=> SUCCESS: Tests pass and don't raise warnings.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 19:11:32 +00:00
1b5a3a0267 Bug 13632: (QA followup) remove xt/permissions.t
There's no longer a need for this tests, as their goal was
to make sure en (the basis) was in sync with the translated
files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 12:42:59 -03:00
Stefan Weil
0cac7bc140 Bug 14383: Fix some typos in comments and documentation
Most of them were found and fixed using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:46 -03:00
5b58e0f0e2 Bug 13941: [1/2] Test <body> tag with id/class attributes
Test:

- Apply the first patch [1/2] containing a new test checking <body> tags in all
  templates
- Run the test: prove xt/tt_valid.t
- You get a list of templates with invalid <body> tags.
- Apply the second patch [2/2] fixing all invalid <body> tags.
- Re-run the test: It passes.

Folowed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-24 09:47:28 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Bernardo Gonzalez Kriegel
d364bea3ad Bug 13199: follow up to fix Licence and some koha-qa errors
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-20 09:47:54 -03:00
48ade942a2 Bug 13199: Test incoherence between 'en' sample notices and translated notices
This test identifies incoherences between translated sample notices and the
'en' reference file.

Koha sample notices are loaded to 'letter' table from a text SQL file
during Koha installation by web installer. The reference file is the one
provided for English (en) installation :

  <koha_root>/installer/data/mysql/en/mandatory/sample_notices.sql

Alternatives files are provided for other languages. Those files are difficult
to keep synchronized with reference file. This could be an functional issue
since some Koha operation depend on notice existence, for example Print Slip in
Circulation.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Test works and identify missing notices
A few koha-qa errors fixed in followup

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-20 09:47:44 -03:00
4a788d4e41 Bug 12653: (RM followup) Fix the test count
Bug 12233 removed the prog and CCSR theme directories, so the number
of tests needs to be fixed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-29 20:43:52 -03:00
Bernardo Gonzalez Kriegel
1852b89afe Bug 12653: PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in tests
This patch removes explicit references of themes from

  xt/author/icondirectories.t
  xt/author/translatable-templates.t
  xt/author/valid-templates.t
  xt/single_quotes.t
  xt/tt_valid.t

For xt/author/icondirectories.t it fixes a small difference on
two bootstrap files, previously unchecked, crystal-clear/_COPYING.txt
and crystal-clear/_README.txt

Some updates to license information

To test:
1. Apply the patch
2. Run each test, all must pass
prove xt/author/icondirectories.t xt/author/translatable-templates.t xt/author/valid-templates.t xt/single_quotes.t xt/tt_valid.t

3. Try to fail each test

a) xt/author/icondirectories.t
create a new file on any of icon dirs, e.g.
touch koha-tmpl/opac-tmpl/bootstrap/itemtypeimg/newfile.png
test must fail

b) xt/author/translatable-templates.t
change the name of 'en' dir on any theme opac or staff
test must fail

Add following line to any template file
<span [% IF ( value ) %]name="name"[% ELSE %] js="_('">TEST [% INCLUDE 'fail.inc' %]</span>

c) xt/author/valid-templates.t must fail
d) xt/single_quotes.t must fail
e) xt/tt_valid.t must fail

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2014-10-30 09:35:12 +13:00
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
Robin Sheat
645cd2d240 Bug 12041 - POD fixing followup
This fixes a minor POD error detected, and also adds the Koha/ directory
to the regular test case so that the in-repo tests can find these
things.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-19 13:05:15 -03:00
Galen Charlton
b97e691ef8 Bug 12271: (follow-up) teach valid-templates.t how to include specified templates
Two of the template includes in the Bootstrap theme cannot be tested
all by themselves because they require that the template that includes
them define BLOCKs.  This patch ensures that they are excluded
from individual testing; they will get exercised sufficiently by being
including by all of the other Bootstrap templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 16:14:28 +00:00
8bc2fb4df6 Bug 12271: add Bootstrap templates to valid-templates.t tests
valid-templates.t actually tests the templates and includes of only
the "prog" theme at opac and intranet.  It does not test the opac
templates and includes of bootstrap theme, nor ccsr.  This is critical
since this test is used for patch integrations in release maintenance.

This patch adds the test of bootstrap opac theme.
I did not manage to add the ccsr theme since it is not a real theme,
meaning it has no templates and not all includes.

Test by runnning perl xt/author/valid-templates.t and looking at the
logs.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Now there are 902 lines, bootstrap tested (1 error detected!)
No koha-qa errors

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 15:58:04 +00:00
Galen Charlton
9a7eedce78 Bug 12076: better detect an untranslatable template construct
Per bug 6458, template constructs of the form

<li [% IF (foo) %]selected="selected"[% END %]...

are forbidden as they can cause problems with translated templates.
However, the tt_valid.t test currently doesn't catch the variation
where '-' is used to suppress extra whitespace:

<li [%- IF (foo) -%]selected="selected"[%- END -%]...

This patch corrects the issue.

To test:

[1] Temporarily add the following line to a template file:

<li [%- IF a -%]a="a"[%- END -%] />

[2] Run prove -v xt/tt_valid.t.  Note that no error is reported.
[3] Apply the patch, and rerun the tt_valid.t test.  This time,
    an error should be reported.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Works well, detects the forbidden pattern
No koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-12 17:57:35 +00:00
1b80e77f84 Bug 11304: fix display of detail page holdings tab in translated Bootstrap theme
Detail page tabs are not displayed properly because JavaScript is broken
in French. This is due to _(' JS string construction used in place of
_(".

This patch fixes:

  - opac-detail.tt page
  - xt/single_quotes to test bootstrap theme

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by applying the patch, running translate update, then translate
install. Saw no JavaScript error on the French detail page.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Switches from single to double quotes for translatatable strings.
Unit tests for xt/single_quotes passes now.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-27 16:52:02 +00:00
Robin Sheat
c9172f49c8 Bug 9802 - add test case to ensure man pages have correct XML
To test:
* run xt/verify-debian-docbook.t and make sure it's all OK
* modify an xml file in debian/docs, try again, make sure it fails

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
- Running "prove -v xt/verify-debian-docbook.t" loops through all the
  XML files in debian/docs and reports them as being ok.
- Removing a "<" from one of the files makes the test report it as
  an error
- I did not verify that the test actually trips up a package build
  if there is invalid XML.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-20 15:11:10 -04:00
27a3d08331 Bug 8942 : Adding a test to make sure we don't use single quotes for js
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by adding single quotes to a translation-escaped string.
Test correctly failed it.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-24 10:28:33 -05:00
9923f65dc2 Bug 8470: remove depreciated H:T:P test
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-26 14:53:13 +02:00
Chris Cormack
3f12a40af6 Bug 5327 : Follow up for TTParser test 2012-07-12 16:06:21 +02:00
Duncan Tyler
8c687edb66 Added coverage to unit test for TTParser
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-07-12 16:06:20 +02:00
Paul Poulain
4fcaa4d31e Revert "Added coverage to unit test for TTParser"
This reverts commit 628788ad8a.
2012-07-06 17:00:48 +02:00
Duncan Tyler
628788ad8a Added coverage to unit test for TTParser
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-06 11:35:20 +02:00
Claire Hernandez
6ee7ad02aa Bug 7994: scripts to check yaml files
$ prove yaml_valid.t
checks a closed list of files
$ perl yaml_valid.pl -f myfile.yaml
try to load a yaml file with YAML::LoadFile and show errors

(both files pertidied)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-06-20 21:07:46 +02:00
Jared Camins-Esakov
d23b5920ac Bug 8022: Permissions test doesn't check all languages
Add the permissions files for es-ES and nb-NO to the permissions test.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Running xt/permissions.t before the patch leaves out nb-NO and es-ES.
After the patch they are picked up and the test fails correctly
because of the missing permissions described in Bug 7984.
As far as I can tall, all permission files are now picked up by
this test.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 15:05:16 +02:00
Paul Poulain
1ffbd262b3 Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-15 13:55:48 +01:00
Paul Poulain
4fa0e4c88c Revert "Added coverage to unit test for TTParser"
This reverts commit 77c4307176.
2012-02-15 13:55:32 +01:00
Paul Poulain
6f6bfb8aff Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-15 10:49:53 +01:00
Duncan Tyler
77c4307176 Added coverage to unit test for TTParser
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-02-15 10:47:25 +01:00
MJ Ray
d4b132136c Bug 7476 Remove executable bit from files that probably should not be executed
Signed-off-by: Aleksa Vujicic <aleksa@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended to replace some copy-and-paste comments only with consent of MJR.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 14:22:15 +01:00
Chris Cormack
2cfb891c83 Bug 929 : Follow up to allow tests to check plugins too
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl xt/author/valid-templates.t runs without errors now.
2012-01-16 18:18:11 +01:00
Paul Poulain
c95cbce4ce fixing the translatable-template.t to handle localized setups
Depending on your locale, msgmerge will return a different messages, enclosed in .... and .
The flow is not utf8 compliant, so this patch switches to testing "..... anything." instead of ".... word."

Now the test work on my (french setup)
2011-11-28 12:13:42 +01:00
Magnus Enger
6bd38d3eab Bug 6537 - squashed version of the previous 5 commits, signed-off
Bug 6537 - Move installer/data/mysql/en/mandatory/sysprefs.sql to installer/data/mysql/sysprefs.sql

Bug 6537 - Make the web installer use installer/data/mysql/sysprefs.sql

Bug 6537 - New syspref files with only the prefs that differ from the default

I have mostly deleted old syspref files and created new ones, with a new name,
mainly in order to reduce the risk of merge conflicts if the old syspref files
are changed before this patch is pushed, if it is pushed.

See http://wiki.koha-community.org/wiki/Simplified_syspref_handling_RFC for
a description of how the new files were created to reflect sysprefs that
differ from the global default.

.txt files have been moved to reflect the new names of the SQL files they are
associated with.

Bug 6537 - Remove syspref-related tests in xt/

As far as I can see, the previous patches for this bug makes the syspref tests
obsolete, and this patch removes them:

xt/syspref.t
xt/check_sysprefs.t

Bug 6537 - Fix a problem in French syspref file

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-07 09:19:07 +12:00
a41100a445 Bug 6458 Template Toolkit files test case
This test validate Template Toolkit (TT) Koha files.

For the time being an unique validation is done: Test if TT files
contain TT directive within HTML tag. For example:

  <li[% IF

This kind of constuction MUST be avoided because it break Koha
translation process.

This patch transform also translation specific modules into C4 modules
in order to be able to use them in test case:

  C4::TTPaser
  C4::TmplToken
  C4::TmplTokenType

This patch is a Perl adaptation of a Haskell script from Frère Sébastien
Marie.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on testing:
- translate install de-DE - worked ok
- translate update de-DE > translate install de-DE - worked ok
- running the test xt/tt_valid.t - worked ok and pointed out lots of problems.
Found no problems.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-18 21:11:50 +12:00
9fd4ff61d8 Bug 6316 - es-ES inclusion - Last fixes
Added diverged sysprefs, and added es-ES to the test list in xt/syspref.t

Yay!
To+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-05 10:20:35 +12:00
Chris Cormack
c2a5e0fd45 Rewriting the valid templates test to test template toolkit 2011-04-29 11:33:19 +12:00
Chris Cormack
7c97e0bfe7 Fixing a utf8 issue with the translator tests 2011-03-06 08:05:40 +13:00
Chris Cormack
24db3d4a44 Fixing the translatable tests to work in french locales 2011-03-04 12:31:48 +13:00
Chris Cormack
423138606e Updating test for systprefs to give more useful output 2010-12-12 20:48:56 +13:00
ce5e2429db fixing various links to point to *.koha-community.org
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-21 22:08:24 -04:00
990eb589d6 add Italian installer SQL to test cases
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-12 10:18:46 -04:00
Chris Nighswonger
b647f01f51 Adding a temporary workaround to keep template tests from borking on very large templates
NOTE: This should be properly fixed at some point in 3.4

This may help:

http://www.perlmonks.org/?node_id=150748

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-07 07:07:50 -04:00
7c0e441d50 replace references to defunct info email address
Now links to Koha project website.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
d40488fe65 fixes to xt/sysprefs.t test case
* use root of source tree as base directory
* ignore case when comparing system preference codes;
  at present this is also case-insenstive in the database
* added German sysprefs file
* corrected paths to Russian and Ukrainian system preference files

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-19 15:56:07 -04:00
05ca029055 fixed problems in xt/permissions.t test case
* now looks for permissions SQL files in the current
  source tree, not in intranetdir; tests in xt/ and
  t/ are meant to be run without requiring a full Koha
  installation
* added path to German
* fixed paths to permissions SQL for Russian and Ukrainian
* handles case where SQL script contains more than just
  inserts into to permissions

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-19 15:48:28 -04:00
ef58c445d3 removed needless imports of the YAML module
Removed instances of 'use YAML' that were either completely
unnecessary or which were used only in debug code.  Also
removed a needless import of Data::Dumper.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 23:30:48 -04:00
64daee5495 fix a common "developement" typo
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 14:38:38 -04:00
0d8b67e73c exclude TinyMCE from non-UTF8 file checks
Since Koha otherwise had made no modifications to the TinyMCE,
we'll leave it alone.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-06 19:55:44 -04:00