How to use category_id_to_category method of pts_ae_data class

Best Phoronix-test-suite code snippet using pts_ae_data.category_id_to_category

pts_ae_data.php

Source:pts_ae_data.php Github

copy

Full Screen

...136 $stmt->bindValue(':c', $component);137 $result = $stmt ? $stmt->execute() : false;138 if($result && ($row = $result->fetchArray()))139 {140 $cache[$component] = $this->category_id_to_category($row['Category']);141 return $row['Category'];142 }143 }144 public function component_id_to_component($component_id)145 {146 static $cache;147 if(isset($cache[$component_id]))148 {149 return $cache[$component_id];150 }151 $stmt = $this->db->prepare('SELECT Component FROM components WHERE ComponentID = :c LIMIT 1');152 $stmt->bindValue(':c', $component_id);153 $result = $stmt ? $stmt->execute() : false;154 if($result && ($row = $result->fetchArray()))155 {156 $cache[$component_id] = $row['Component'];157 return $cache[$component_id];158 }159 }160 public function category_to_category_id($category)161 {162 static $cache;163 if(isset($cache[$category]))164 {165 return $cache[$category];166 }167 $stmt = $this->db->prepare('SELECT CategoryID FROM component_categories WHERE Category = :c LIMIT 1');168 $stmt->bindValue(':c', $category);169 $result = $stmt ? $stmt->execute() : false;170 if($result && ($row = $result->fetchArray()))171 {172 $cache[$category] = $row['CategoryID'];173 return $row['CategoryID'];174 }175 $stmt = $this->db->prepare('INSERT OR IGNORE INTO component_categories (Category) VALUES (:category)');176 $stmt->bindValue(':category', $category);177 $result = $stmt->execute();178 $cache[$category] = $this->db->lastInsertRowid();179 return $cache[$category];180 }181 public function category_id_to_category($category_id)182 {183 static $cache;184 if(isset($cache[$category_id]))185 {186 return $cache[$category_id];187 }188 $stmt = $this->db->prepare('SELECT Category FROM component_categories WHERE CategoryID = :c LIMIT 1');189 $stmt->bindValue(':c', $category_id);190 $result = $stmt ? $stmt->execute() : false;191 if($result && ($row = $result->fetchArray()))192 {193 $cache[$category_id] = $row['Category'];194 return $row['Category'];195 }...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger category_id_to_category code on LambdaTest Cloud Grid

Execute automation tests with category_id_to_category on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful