14 local $SIG{__WARN__} = sub { die @_ };
16 like($@, qr/The many-to-many relationship bars/,
17 "Warning triggered without relevant 'no warnings'");
22 $no_warn = "no warnings 'DBIx::Class::Relationship::ManyToMany';";
24 local $SIG{__WARN__} = sub { die @_ };
26 unlike($@, qr/The many-to-many relationship bars.*?Bar2/s,
27 "No warning triggered with relevant 'no warnings'");
37 DBICTest::Schema::Foo$suffix;
38 use base 'DBIx::Class::Core';
39 __PACKAGE__->table('foo');
40 __PACKAGE__->add_columns(
42 data_type => 'integer',
43 is_auto_increment => 1,
46 __PACKAGE__->set_primary_key('fooid');
49 __PACKAGE__->has_many('foo_to_bar' => 'DBICTest::Schema::FooToBar$main::suffix' => 'bar');
50 __PACKAGE__->many_to_many( foos => foo_to_bar => 'bar' );
55 DBICTest::Schema::FooToBar$suffix;
57 use base 'DBIx::Class::Core';
58 __PACKAGE__->table('foo_to_bar');
59 __PACKAGE__->add_columns(
61 data_type => 'integer',
64 data_type => 'integer',
67 __PACKAGE__->belongs_to('foo' => 'DBICTest::Schema::Foo$main::suffix');
68 __PACKAGE__->belongs_to('bar' => 'DBICTest::Schema::Foo$main::suffix');
72 DBICTest::Schema::Bar$suffix;
73 use base 'DBIx::Class::Core';
74 __PACKAGE__->table('bar');
75 __PACKAGE__->add_columns(
77 data_type => 'integer',
78 is_auto_increment => 1,
82 use DBIx::Class::Relationship::ManyToMany;
84 __PACKAGE__->set_primary_key('barid');
85 __PACKAGE__->has_many('foo_to_bar' => 'DBICTest::Schema::FooToBar$main::suffix' => 'foo');
86 __PACKAGE__->many_to_many( bars => foo_to_bar => 'foo' );