Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
RedBeanModelRelationToColumnAdapterTest.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
38  {
39  protected static $messageLogger;
40 
41  public static function setUpBeforeClass()
42  {
43  parent::setUpBeforeClass();
44  SecurityTestHelper::createSuperAdmin();
45  $super = User::getByUsername('super');
46  Yii::app()->user->userModel = $super;
47  static::$messageLogger = new MessageLogger();
48  }
49 
50  public function testResolveWithEmptyModelClassName()
51  {
52  $modelClassName = null;
53  $relationName = 'ThirdCousin';
54  $relationMetadata = array(RedBeanModel::HAS_ONE, 'Person');
55  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
56  $relationName,
57  $relationMetadata,
58  static::$messageLogger);
59  $this->assertFalse($column);
60  }
61 
66  {
67  $modelClassName = 'ModelClass';
68  $relationName = 'ThirdCousin';
69  $relationMetadata = array(RedBeanModel::HAS_ONE, 'Person');
70  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
71  $relationName,
72  $relationMetadata,
73  static::$messageLogger);
74  $this->assertFalse($column);
75  }
76 
81  {
82  $modelClassName = 'User';
83  $relationName = null;
84  $relationMetadata = array(RedBeanModel::HAS_ONE, 'Person');
85  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
86  $relationName,
87  $relationMetadata,
88  static::$messageLogger);
89  $this->assertFalse($column);
90  }
91 
96  {
97  $modelClassName = 'User';
98  $relationName = 'ThirdCousin';
99  $relationMetadata = array('Person');
100  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
101  $relationName,
102  $relationMetadata,
103  static::$messageLogger);
104  $this->assertFalse($column);
105  }
106 
111  {
112  $modelClassName = 'User';
113  $relationName = 'ThirdCousin';
114  $relationMetadata = array(RedBeanModel::HAS_ONE, null);
115  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
116  $relationName,
117  $relationMetadata,
118  static::$messageLogger);
119  $this->assertFalse($column);
120  }
121 
126  {
127  $modelClassName = 'User';
128  $relationName = 'ThirdCousin';
129  $relationMetadata = array(RedBeanModel::HAS_ONE, 'ModelClass');
130  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
131  $relationName,
132  $relationMetadata,
133  static::$messageLogger);
134  $this->assertFalse($column);
135  }
136 
141  {
142  $modelClassName = 'User';
143  $relationName = 'ThirdCousin';
144  $relationMetadata = array(100, 'Person');
145  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
146  $relationName,
147  $relationMetadata,
148  static::$messageLogger);
149  $this->assertFalse($column);
150  }
151 
156  {
157  $modelClassName = 'Mission';
158  $relationName = 'takenByUser';
159  $relationMetadata = array(RedBeanModel::HAS_ONE, 'User', RedBeanModel::NOT_OWNED, 10, 'takenByUser');
160  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
161  $relationName,
162  $relationMetadata,
163  static::$messageLogger);
164  $this->assertNotEmpty($column);
165  $this->assertArrayHasKey('name', $column);
166  $this->assertArrayHasKey('type', $column);
167  $this->assertArrayHasKey('unsigned', $column);
168  $this->assertArrayHasKey('notNull', $column);
169  $this->assertArrayHasKey('collation', $column);
170  $this->assertArrayHasKey('default', $column);
171  $this->assertEquals('takenbyuser__user_id', $column['name']);
172  $this->assertEquals('INT(11)', $column['type']);
173  $this->assertEquals('UNSIGNED', $column['unsigned']);
174  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
175  $this->assertNull($column['collation']);
176  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
177  }
178 
183  {
184  $modelClassName = 'Autoresponder';
185  $relationName = 'marketingList';
186  $relationMetadata = array(RedBeanModel::HAS_ONE, 'MarketingList', RedBeanModel::NOT_OWNED);
187  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
188  $relationName,
189  $relationMetadata,
190  static::$messageLogger);
191  $this->assertNotEmpty($column);
192  $this->assertArrayHasKey('name', $column);
193  $this->assertArrayHasKey('type', $column);
194  $this->assertArrayHasKey('unsigned', $column);
195  $this->assertArrayHasKey('notNull', $column);
196  $this->assertArrayHasKey('collation', $column);
197  $this->assertArrayHasKey('default', $column);
198  $this->assertEquals('marketinglist_id', $column['name']);
199  $this->assertEquals('INT(11)', $column['type']);
200  $this->assertEquals('UNSIGNED', $column['unsigned']);
201  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
202  $this->assertNull($column['collation']);
203  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
204  }
205 
210  {
211  $modelClassName = 'SocialItem';
212  $relationName = 'toUser';
213  $relationMetadata = array(RedBeanModel::HAS_ONE, 'User', RedBeanModel::NOT_OWNED);
214  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
215  $relationName,
216  $relationMetadata,
217  static::$messageLogger);
218  $this->assertNotEmpty($column);
219  $this->assertArrayHasKey('name', $column);
220  $this->assertArrayHasKey('type', $column);
221  $this->assertArrayHasKey('unsigned', $column);
222  $this->assertArrayHasKey('notNull', $column);
223  $this->assertArrayHasKey('collation', $column);
224  $this->assertArrayHasKey('default', $column);
225  $this->assertEquals('touser_touser__user_id', $column['name']);
226  $this->assertEquals('INT(11)', $column['type']);
227  $this->assertEquals('UNSIGNED', $column['unsigned']);
228  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
229  $this->assertNull($column['collation']);
230  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
231  }
232 
237  {
238  $modelClassName = 'SocialItem';
239  $relationName = 'toUser';
240  $relationMetadata = array(RedBeanModel::HAS_ONE, 'User', RedBeanModel::NOT_OWNED,
241  RedBeanModel::LINK_TYPE_ASSUMPTIVE);
242  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
243  $relationName,
244  $relationMetadata,
245  static::$messageLogger);
246  $this->assertNotEmpty($column);
247  $this->assertArrayHasKey('name', $column);
248  $this->assertArrayHasKey('type', $column);
249  $this->assertArrayHasKey('unsigned', $column);
250  $this->assertArrayHasKey('notNull', $column);
251  $this->assertArrayHasKey('collation', $column);
252  $this->assertArrayHasKey('default', $column);
253  $this->assertEquals('touser_touser__user_id', $column['name']);
254  $this->assertEquals('INT(11)', $column['type']);
255  $this->assertEquals('UNSIGNED', $column['unsigned']);
256  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
257  $this->assertNull($column['collation']);
258  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
259  }
260 
265  {
266  $modelClassName = 'SocialItem';
267  $relationName = 'toUser';
268  $relationMetadata = array(RedBeanModel::HAS_ONE, 'User', RedBeanModel::NOT_OWNED,
269  RedBeanModel::LINK_TYPE_SPECIFIC, 'toUser');
270  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
271  $relationName,
272  $relationMetadata,
273  static::$messageLogger);
274  $this->assertNotEmpty($column);
275  $this->assertArrayHasKey('name', $column);
276  $this->assertArrayHasKey('type', $column);
277  $this->assertArrayHasKey('unsigned', $column);
278  $this->assertArrayHasKey('notNull', $column);
279  $this->assertArrayHasKey('collation', $column);
280  $this->assertArrayHasKey('default', $column);
281  $this->assertEquals('touser__user_id', $column['name']);
282  $this->assertEquals('INT(11)', $column['type']);
283  $this->assertEquals('UNSIGNED', $column['unsigned']);
284  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
285  $this->assertNull($column['collation']);
286  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
287  }
288 
293  {
294  $modelClassName = 'Account';
295  $relationName = 'opportunity';
296  $relationMetadata = array(RedBeanModel::HAS_MANY, 'Opportunity');
297  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
298  $relationName,
299  $relationMetadata,
300  static::$messageLogger);
301  $this->assertNull($column);
302  }
303 
308  {
309  $modelClassName = 'Account';
310  $relationName = 'accountOpportunities';
311  $relationMetadata = array(RedBeanModel::HAS_MANY, 'Opportunity');
312  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
313  $relationName,
314  $relationMetadata,
315  static::$messageLogger);
316  $this->assertNull($column);
317  }
318 
323  {
324  $modelClassName = 'Account';
325  $relationName = 'accountOpportunities';
326  $relationMetadata = array(RedBeanModel::HAS_MANY, 'Opportunity',
327  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_ASSUMPTIVE);
328  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
329  $relationName,
330  $relationMetadata,
331  static::$messageLogger);
332  $this->assertNull($column);
333  }
334 
339  {
340  $modelClassName = 'Account';
341  $relationName = 'accountOpportunities';
342  $relationMetadata = array(RedBeanModel::HAS_MANY, 'Opportunity',
343  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'accountOpt');
344  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
345  $relationName,
346  $relationMetadata,
347  static::$messageLogger);
348  $this->assertNull($column);
349  }
350 
355  {
356  $modelClassName = 'Campaign';
357  $relationName = 'files';
358  $relationMetadata = array(RedBeanModel::HAS_MANY, 'FileModel', RedBeanModel::OWNED,
359  RedBeanModel::LINK_TYPE_POLYMORPHIC, 'relatedModel');
360  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
361  $relationName,
362  $relationMetadata,
363  static::$messageLogger);
364  $this->assertNull($column);
366  $this->assertNotEmpty($polymorphicColumns);
367  $this->assertCount(2, $polymorphicColumns);
368  $this->assertArrayHasKey('name', $polymorphicColumns[0]);
369  $this->assertArrayHasKey('type', $polymorphicColumns[0]);
370  $this->assertArrayHasKey('unsigned', $polymorphicColumns[0]);
371  $this->assertArrayHasKey('notNull', $polymorphicColumns[0]);
372  $this->assertArrayHasKey('collation', $polymorphicColumns[0]);
373  $this->assertArrayHasKey('default', $polymorphicColumns[0]);
374  $this->assertEquals('relatedmodel_id', $polymorphicColumns[0]['name']);
375  $this->assertEquals('INT(11)', $polymorphicColumns[0]['type']);
376  $this->assertEquals('UNSIGNED', $polymorphicColumns[0]['unsigned']);
377  $this->assertEquals('NULL', $polymorphicColumns[0]['notNull']); // Not Coding Standard
378  $this->assertNull($polymorphicColumns[0]['collation']);
379  $this->assertEquals('DEFAULT NULL', $polymorphicColumns[0]['default']); // Not Coding Standard
380 
381  $this->assertArrayHasKey('name', $polymorphicColumns[1]);
382  $this->assertArrayHasKey('type', $polymorphicColumns[1]);
383  $this->assertArrayHasKey('unsigned', $polymorphicColumns[1]);
384  $this->assertArrayHasKey('notNull', $polymorphicColumns[1]);
385  $this->assertArrayHasKey('collation', $polymorphicColumns[1]);
386  $this->assertArrayHasKey('default', $polymorphicColumns[1]);
387  $this->assertEquals('relatedmodel_type', $polymorphicColumns[1]['name']);
388  $this->assertEquals('VARCHAR(255)', $polymorphicColumns[1]['type']);
389  $this->assertNull($polymorphicColumns[1]['unsigned']);
390  $this->assertEquals('NULL', $polymorphicColumns[1]['notNull']); // Not Coding Standard
391  $this->assertEquals('COLLATE utf8_unicode_ci', $polymorphicColumns[1]['collation']);
392  $this->assertEquals('DEFAULT NULL', $polymorphicColumns[1]['default']); // Not Coding Standard
393  }
394 
399  {
400  $modelClassName = 'K';
401  $relationName = 'i';
402  $relationMetadata = array(RedBeanModel::HAS_MANY_BELONGS_TO, 'I');
403  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
404  $relationName,
405  $relationMetadata,
406  static::$messageLogger);
407  $this->assertNotEmpty($column);
408  $this->assertArrayHasKey('name', $column);
409  $this->assertArrayHasKey('type', $column);
410  $this->assertArrayHasKey('unsigned', $column);
411  $this->assertArrayHasKey('notNull', $column);
412  $this->assertArrayHasKey('collation', $column);
413  $this->assertArrayHasKey('default', $column);
414  $this->assertEquals('i_id', $column['name']);
415  $this->assertEquals('INT(11)', $column['type']);
416  $this->assertEquals('UNSIGNED', $column['unsigned']);
417  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
418  $this->assertNull($column['collation']);
419  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
420  }
421 
426  {
427  $modelClassName = 'K';
428  $relationName = 'i';
429  $relationMetadata = array(RedBeanModel::HAS_MANY_BELONGS_TO, 'I');
430  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
431  $relationName,
432  $relationMetadata,
433  static::$messageLogger);
434  $this->assertNotEmpty($column);
435  $this->assertArrayHasKey('name', $column);
436  $this->assertArrayHasKey('type', $column);
437  $this->assertArrayHasKey('unsigned', $column);
438  $this->assertArrayHasKey('notNull', $column);
439  $this->assertArrayHasKey('collation', $column);
440  $this->assertArrayHasKey('default', $column);
441  $this->assertEquals('i_id', $column['name']);
442  $this->assertEquals('INT(11)', $column['type']);
443  $this->assertEquals('UNSIGNED', $column['unsigned']);
444  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
445  $this->assertNull($column['collation']);
446  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
447  }
448 
453  {
454  $modelClassName = 'K';
455  $relationName = 'ii';
456  $relationMetadata = array(RedBeanModel::HAS_MANY_BELONGS_TO, 'II',
457  RedBeanModel::NOT_OWNED, RedBeanModel::LINK_TYPE_ASSUMPTIVE);
458  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
459  $relationName,
460  $relationMetadata,
461  static::$messageLogger);
462  $this->assertNotEmpty($column);
463  $this->assertArrayHasKey('name', $column);
464  $this->assertArrayHasKey('type', $column);
465  $this->assertArrayHasKey('unsigned', $column);
466  $this->assertArrayHasKey('notNull', $column);
467  $this->assertArrayHasKey('collation', $column);
468  $this->assertArrayHasKey('default', $column);
469  $this->assertEquals('ii_id', $column['name']);
470  $this->assertEquals('INT(11)', $column['type']);
471  $this->assertEquals('UNSIGNED', $column['unsigned']);
472  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
473  $this->assertNull($column['collation']);
474  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
475  }
476 
481  {
482  $modelClassName = 'K';
483  $relationName = 'iii';
484  $relationMetadata = array(RedBeanModel::HAS_MANY_BELONGS_TO, 'III', RedBeanModel::OWNED,
485  RedBeanModel::LINK_TYPE_SPECIFIC, 'ilink');
486  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
487  $relationName,
488  $relationMetadata,
489  static::$messageLogger);
490  $this->assertNotEmpty($column);
491  $this->assertArrayHasKey('name', $column);
492  $this->assertArrayHasKey('type', $column);
493  $this->assertArrayHasKey('unsigned', $column);
494  $this->assertArrayHasKey('notNull', $column);
495  $this->assertArrayHasKey('collation', $column);
496  $this->assertArrayHasKey('default', $column);
497  $this->assertEquals('iii_id', $column['name']);
498  $this->assertEquals('INT(11)', $column['type']);
499  $this->assertEquals('UNSIGNED', $column['unsigned']);
500  $this->assertEquals('NULL', $column['notNull']); // Not Coding Standard
501  $this->assertNull($column['collation']);
502  $this->assertEquals('DEFAULT NULL', $column['default']); // Not Coding Standard
503  }
504 
509  {
510  $modelClassName = 'J';
511  $relationName = 'i';
512  $relationMetadata = array(RedBeanModel::HAS_ONE_BELONGS_TO, 'I');
513  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
514  $relationName,
515  $relationMetadata,
516  static::$messageLogger);
517  $this->assertNull($column);
518  }
519 
524  {
525  $modelClassName = 'J';
526  $relationName = 'ii';
527  $relationMetadata = array(RedBeanModel::HAS_ONE_BELONGS_TO, 'I');
528  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
529  $relationName,
530  $relationMetadata,
531  static::$messageLogger);
532  $this->assertNull($column);
533  }
534 
539  {
540  $modelClassName = 'J';
541  $relationName = 'i';
542  $relationMetadata = array(RedBeanModel::HAS_ONE_BELONGS_TO, 'I',
543  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_ASSUMPTIVE);
544  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
545  $relationName,
546  $relationMetadata,
547  static::$messageLogger);
548  $this->assertNull($column);
549  }
550 
555  {
556  $modelClassName = 'J';
557  $relationName = 'i';
558  $relationMetadata = array(RedBeanModel::HAS_ONE_BELONGS_TO, 'I',
559  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'ilink');
560  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
561  $relationName,
562  $relationMetadata,
563  static::$messageLogger);
564  $this->assertNull($column);
565  }
566 
571  {
572  $modelClassName = 'J';
573  $relationName = 'i';
574  $relationMetadata = array(RedBeanModel::HAS_ONE_BELONGS_TO, 'I',
575  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_POLYMORPHIC, 'ipoly');
576  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
577  $relationName,
578  $relationMetadata,
579  static::$messageLogger);
580  $this->assertNull($column);
581  }
582 
587  {
588  $modelClassName = 'Contact';
589  $relationName = 'opportunity';
590  $relationMetadata = array(RedBeanModel::MANY_MANY, 'Opportunity');
591  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
592  $relationName,
593  $relationMetadata,
594  static::$messageLogger);
595  $this->assertNull($column);
596  $processedTables = RedBeanModelToJoinTableAdapter::resolveProcessedTableNames();
597  $this->assertNotEmpty($processedTables);
598  $this->assertCount(1, $processedTables);
599  $this->assertEquals('contact_opportunity', $processedTables[0]);
600  }
601 
606  {
607  $modelClassName = 'Conversation';
608  $relationName = 'conversationItems';
609  $relationMetadata = array(RedBeanModel::MANY_MANY, 'Item');
610  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
611  $relationName,
612  $relationMetadata,
613  static::$messageLogger);
614  $this->assertNull($column);
615  $processedTables = RedBeanModelToJoinTableAdapter::resolveProcessedTableNames();
616  $this->assertNotEmpty($processedTables);
617  $this->assertCount(2, $processedTables);
618  $this->assertEquals('contact_opportunity', $processedTables[0]);
619  $this->assertEquals('conversation_item', $processedTables[1]);
620  }
621 
626  {
627  $modelClassName = 'Conversation';
628  $relationName = 'conversationItems';
629  $relationMetadata = array(RedBeanModel::MANY_MANY, 'Item',
630  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_ASSUMPTIVE);
631  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
632  $relationName,
633  $relationMetadata,
634  static::$messageLogger);
635  $this->assertNull($column);
636  $processedTables = RedBeanModelToJoinTableAdapter::resolveProcessedTableNames();
637  $this->assertNotEmpty($processedTables);
638  $this->assertCount(2, $processedTables);
639  $this->assertEquals('contact_opportunity', $processedTables[0]);
640  $this->assertEquals('conversation_item', $processedTables[1]);
641  }
642 
647  {
648  $modelClassName = 'Conversation';
649  $relationName = 'conversationItems';
650  $relationMetadata = array(RedBeanModel::MANY_MANY, 'Item',
651  RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'cItems');
652  $column = RedBeanModelRelationToColumnAdapter::resolve($modelClassName,
653  $relationName,
654  $relationMetadata,
655  static::$messageLogger);
656  $this->assertNull($column);
657  $processedTables = RedBeanModelToJoinTableAdapter::resolveProcessedTableNames();
658  $this->assertNotEmpty($processedTables);
659  $this->assertCount(3, $processedTables);
660  $this->assertEquals('contact_opportunity', $processedTables[0]);
661  $this->assertEquals('conversation_item', $processedTables[1]);
662  $this->assertEquals('citems_conversation_item', $processedTables[2]);
663  }
664  }
665 ?>
static getByUsername($username)
Definition: User.php:49
const OWNED
Definition: BeanModel.php:87
const HAS_ONE
Definition: BeanModel.php:64
const HAS_ONE_BELONGS_TO
Definition: BeanModel.php:48
const MANY_MANY
Definition: BeanModel.php:78
static resolve($modelClassName, $relationName, array $relationMetadata, &$messageLogger)
const HAS_MANY_BELONGS_TO
Definition: BeanModel.php:58
const HAS_MANY
Definition: BeanModel.php:71
Generated on Thu Jul 9 2020 07:10:29
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.