Temporary fixes for 5.13.x $@ handling
[dbsrgits/DBIx-Class.git] / t / relationship / doesnt_exist.t
CommitLineData
e60dc79f 1use strict;
5e8cb53c 2use warnings;
e60dc79f 3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8my $schema = DBICTest->init_schema();
9
10plan tests => 3;
11
12my $bookmark = $schema->resultset("Bookmark")->find(1);
13my $link = $bookmark->link;
14my $link_id = $link->id;
15ok $link->id;
16
17$link->delete;
18is $schema->resultset("Link")->search(id => $link_id)->count, 0,
19 "link $link_id was deleted";
20
21# Get a fresh object with nothing cached
22$bookmark = $schema->resultset("Bookmark")->find($bookmark->id);
23
24# This would create a new link row if none existed
25$bookmark->link;
26
27is $schema->resultset("Link")->search(id => $link_id)->count, 0,
28 'accessor did not create a link object where there was none';