コード例 #1
0
 public function testGetListViewQueryCreatedBy()
 {
     require_once "include/ListView/ListViewDisplay.php";
     include "modules/Notes/metadata/listviewdefs.php";
     $displayColumns = array('NAME' => array('width' => '40%', 'label' => 'LBL_LIST_SUBJECT', 'link' => true, 'default' => true), 'CREATED_BY_NAME' => array('type' => 'relate', 'label' => 'LBL_CREATED_BY', 'width' => '10%', 'default' => true));
     $lvd = new ListViewDisplay();
     $lvd->displayColumns = $displayColumns;
     $fields = $lvd->setupFilterFields();
     $query = $this->note->create_new_list_query('', 'id="' . $this->note->id . '"', $fields);
     $regex = '/select.* created_by_name.*LEFT JOIN\\s*users jt\\d ON\\s*notes.created_by\\s*=\\s*jt\\d\\.id.*/si';
     return $this->assertRegExp($regex, $query, "Unable to find the created user in the notes list view query: {$query}");
 }