@@ -58,3 +58,61 @@ update:
58
58
strip-prefix : v
59
59
tag-filter : v
60
60
use-tag : true
61
+
62
+ test :
63
+ pipeline :
64
+ - name : " Check if extension is loaded"
65
+ runs : |
66
+ php -m | grep -i "apcu"
67
+ - name : " Verify extension version"
68
+ runs : |
69
+ php -r 'echo phpversion("apcu");'
70
+ - name : " Test basic cache storage and retrieval"
71
+ runs : |
72
+ php -d apc.enable_cli=1 -r '
73
+ if (!apcu_store("test_key", "test_value")) exit(1);
74
+ $value = apcu_fetch("test_key");
75
+ if ($value !== "test_value") exit(1);
76
+ echo "Success";
77
+ '
78
+ - name : " Test cache exists functionality"
79
+ runs : |
80
+ php -d apc.enable_cli=1 -r '
81
+ if (!apcu_store("check_key", "check_value")) exit(1);
82
+ if (!apcu_exists("check_key")) exit(1);
83
+ if (apcu_exists("nonexistent_key")) exit(1);
84
+ echo "Success";
85
+ '
86
+ - name : " Test cache deletion"
87
+ runs : |
88
+ php -d apc.enable_cli=1 -r '
89
+ if (!apcu_store("delete_key", "delete_value")) exit(1);
90
+ if (!apcu_delete("delete_key")) exit(1);
91
+ if (apcu_exists("delete_key")) exit(1);
92
+ echo "Success";
93
+ '
94
+ - name : " Test cache clearing"
95
+ runs : |
96
+ php -d apc.enable_cli=1 -r '
97
+ if (!apcu_store("clear_key", "clear_value")) exit(1);
98
+ if (!apcu_clear_cache()) exit(1);
99
+ if (apcu_exists("clear_key")) exit(1);
100
+ echo "Success";
101
+ '
102
+ - name : " Test increment/decrement operations"
103
+ runs : |
104
+ php -d apc.enable_cli=1 -r '
105
+ if (!apcu_store("counter", 5)) exit(1);
106
+ if (apcu_inc("counter") !== 6) exit(1);
107
+ if (apcu_dec("counter") !== 5) exit(1);
108
+ echo "Success";
109
+ '
110
+ - name : " Verify configuration file"
111
+ runs : |
112
+ grep -q "^extension=apcu.so" /etc/php/conf.d/apcu.ini
113
+ - name : " Verify APCu is enabled in CLI"
114
+ runs : |
115
+ php -d apc.enable_cli=1 -r '
116
+ if (!ini_get("apc.enable_cli")) exit(1);
117
+ echo "APCu CLI mode enabled";
118
+ '
0 commit comments