|
Lines 19-27
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 2; |
22 |
use Test::More tests => 3; |
| 23 |
|
23 |
|
| 24 |
use Koha::Authority::Types; |
24 |
use Koha::Authority::Types; |
|
|
25 |
use Koha::Cities; |
| 25 |
use Koha::Patrons; |
26 |
use Koha::Patrons; |
| 26 |
use Koha::Database; |
27 |
use Koha::Database; |
| 27 |
|
28 |
|
|
Lines 36-40
my @columns = Koha::Patrons->columns;
Link Here
|
| 36 |
my $borrowernumber_exists = grep { /^borrowernumber$/ } @columns; |
37 |
my $borrowernumber_exists = grep { /^borrowernumber$/ } @columns; |
| 37 |
is( $borrowernumber_exists, 1, 'Koha::Objects->columns should return the table columns' ); |
38 |
is( $borrowernumber_exists, 1, 'Koha::Objects->columns should return the table columns' ); |
| 38 |
|
39 |
|
|
|
40 |
subtest 'update' => sub { |
| 41 |
plan tests => 2; |
| 42 |
my $builder = t::lib::TestBuilder->new; |
| 43 |
$builder->build( { source => 'City', value => { city_country => 'UK' } } ); |
| 44 |
$builder->build( { source => 'City', value => { city_country => 'UK' } } ); |
| 45 |
$builder->build( { source => 'City', value => { city_country => 'UK' } } ); |
| 46 |
$builder->build( { source => 'City', value => { city_country => 'France' } } ); |
| 47 |
$builder->build( { source => 'City', value => { city_country => 'France' } } ); |
| 48 |
$builder->build( { source => 'City', value => { city_country => 'Germany' } } ); |
| 49 |
Koha::Cities->search( { city_country => 'UK' } )->update( { city_country => 'EU' } ); |
| 50 |
is( Koha::Cities->search( { city_country => 'EU' } )->count, 3, 'Koha::Objects->update should have updated the 3 rows' ); |
| 51 |
is( Koha::Cities->search( { city_country => 'UK' } )->count, 0, 'Koha::Objects->update should have updated the 3 rows' ); |
| 52 |
}; |
| 53 |
|
| 39 |
$schema->storage->txn_rollback; |
54 |
$schema->storage->txn_rollback; |
| 40 |
1; |
55 |
1; |
| 41 |
- |
|
|