]> git.koha-community.org Git - koha.git/commit
Bug 13230: t/Biblio.t should run without a DB
authorTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 11 Nov 2014 02:59:36 +0000 (23:59 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 11 Nov 2014 12:43:31 +0000 (09:43 -0300)
commit561b474bc98e6c60d808ccdcb68a96c9c817dc48
treef9b7ff5630f1e8b04c9d2f21e5f8026cc10d664b
parent88cccca185ac1a4242b93bf0704429743aa71b91
Bug 13230: t/Biblio.t should run without a DB

This patch makes t/Biblio.t mock the DB connexion setting
a void one. All tests in this file currently call the C4::Biblio
functions with invalid (absent) parameters, so they are expected to
raise warnings and return undef values.

If someone writes mocked tests for the rest of the functionality,
it is expected to mock the DB calls to match the desired scenario.

To test:
- Turn of MySQL
- Run
  $ prove t/Biblio.t
=> FAIL: Tests fail because of missing MySQL server
- Apply the patch
- Run
  $ prove t/Biblio.t
=> SUCCESS: Tests now pass
- Start MySQL
- Run
  $ prove t/Biblio.t
=> SUCCESS: Tests still pass
- Sign off

Regards
Tomas

Sponsored-by: The will to procrastinate
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Sponsored-by: Wanting the darn packages to build
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Sponsored-by: Not wanting to read in my maths book
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/Biblio.t