Source

pecl-event / tests / 02-features.phpt

Diff from to

tests/02-features.phpt

 Check for event configuration features 
 --FILE--
 <?php 
-$cfg = event_config_new();
+$cfg = new EventConfig();
 
-if (event_config_require_features($cfg, EVENT_FEATURE_FDS)) {
-	$base = event_base_new_with_config($cfg);
+if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
+	$base = new EventBase($cfg);
 
-	if (event_base_get_features($base) & EVENT_FEATURE_FDS) {
+	if ($base->getFeatures() & EventConfig::FEATURE_FDS) {
 		echo "FDS\n";
 	}
 }
 
-if (event_config_require_features($cfg, EVENT_FEATURE_ET)) {
-	$base = event_base_new_with_config($cfg);
+if ($cfg->requireFeatures(EventConfig::FEATURE_ET)) {
+	$base = new EventBase($cfg);
 
-	if (event_base_get_features($base) & EVENT_FEATURE_ET) {
+	if ($base->getFeatures() & EventConfig::FEATURE_ET) {
 		echo "ET\n";
 	}
 }
 
-if (event_config_require_features($cfg, EVENT_FEATURE_O1)) {
-	$base = event_base_new_with_config($cfg);
+if ($cfg->requireFeatures(EventConfig::FEATURE_O1)) {
+	$base = new EventBase($cfg);
 
-	if (event_base_get_features($base) & EVENT_FEATURE_O1) {
+	if ($base->getFeatures() & EventConfig::FEATURE_O1) {
 		echo "O1\n";
 	}
 }