|
26 | 26 | ;;
|
27 | 27 |
|
28 | 28 | ;;; Code:
|
29 |
| - |
30 |
| -;; Without composer |
31 |
| -(ert-deftest ede-php-autoload-wt-composer-project-is-defined () |
| 29 | +(ert-deftest ede-php-autoload-project-is-defined () |
32 | 30 | "The EDE php autoload project should be defined."
|
33 | 31 | (with-current-project-file "main.php" "without-composer"
|
34 | 32 | (should (ede-php-autoload-project-p (ede-current-project)))))
|
35 | 33 |
|
36 |
| -(define-class-definition-test ede-php-autoload-wt-composer-find-psr0 () |
| 34 | +(define-class-definition-test ede-php-autoload-find-psr0 () |
37 | 35 | "The definition for a PSR-4 class should be found."
|
38 | 36 | :class "Psr0Ns_TheClass"
|
39 | 37 | :file-name "src/Psr0Ns/TheClass.php"
|
40 | 38 | :project "without-composer")
|
41 | 39 |
|
42 |
| -(define-class-definition-test ede-php-autoload-wt-composer-find-psr4 () |
| 40 | +(define-class-definition-test ede-php-autoload-find-psr4 () |
43 | 41 | "The definition for a PSR-4 class should be found."
|
44 | 42 | :class "Psr4Ns\\TheClass"
|
45 | 43 | :file-name "src/Psr4Ns/TheClass.php"
|
46 | 44 | :project "without-composer")
|
47 | 45 |
|
48 |
| -(define-class-definition-test ede-php-autoload-wt-composer-find-multidir-1 () |
| 46 | +(define-class-definition-test ede-php-autoload-find-multidir-1 () |
49 | 47 | "The definition of the first item of a multi-directory namespace should be found."
|
50 | 48 | :class "MultiDirNs\\TheClass1"
|
51 | 49 | :file-name "src/MultiDirNs1/TheClass1.php"
|
52 | 50 | :project "without-composer")
|
53 | 51 |
|
54 |
| -(define-class-definition-test ede-php-autoload-wt-composer-find-multidir-2 () |
| 52 | +(define-class-definition-test ede-php-autoload-find-multidir-2 () |
55 | 53 | "The definition of the non-first item of a multi-directory namespace should be found."
|
56 | 54 | :class "MultiDirNs\\TheClass2"
|
57 | 55 | :file-name "src/MultiDirNs2/TheClass2.php"
|
58 | 56 | :project "without-composer")
|
59 | 57 |
|
60 |
| -(define-class-definition-test ede-php-autoload-wt-composer-find-nothing () |
61 |
| - "nil should be returned when no definition have been found." |
62 |
| - :class "Psr4Ns\\DoesNotExist" |
63 |
| - :file-name nil |
| 58 | +(define-class-definition-test ede-php-autoload-find-psr0-split-without-clash () |
| 59 | + "The definition of a class in a split namespace (iwht multiple sub-namespaces) should be found on PSR-0." |
| 60 | + :class "Psr0Split\\Ns2\\TheClass" |
| 61 | + :file-name "src/Psr0Split/Ns2/TheClass.php" |
64 | 62 | :project "without-composer")
|
65 | 63 |
|
66 |
| -;; With composer |
67 |
| -(ert-deftest ede-php-autoload-composer-project-is-defined () |
68 |
| - "The EDE php autoload project should be defined." |
69 |
| - (with-current-project-file "main.php" "with-composer" |
70 |
| - (should (ede-php-autoload-project-p (ede-current-project))))) |
71 |
| - |
72 |
| -(define-class-definition-test ede-php-autoload-composer-find-psr0 () |
73 |
| - "The definition for a PSR-4 class should be found." |
74 |
| - :class "Psr0Ns_TheClass" |
75 |
| - :file-name "src/Psr0Ns/TheClass.php" |
76 |
| - :project "with-composer") |
77 |
| - |
78 |
| -(define-class-definition-test ede-php-autoload-composer-find-psr4 () |
79 |
| - "The definition for a PSR-4 class should be found." |
80 |
| - :class "Psr4Ns\\TheClass" |
81 |
| - :file-name "src/Psr4Ns/TheClass.php" |
82 |
| - :project "with-composer") |
83 |
| - |
84 |
| -(define-class-definition-test ede-php-autoload-composer-find-multidir-1 () |
85 |
| - "The definition of the first item of a multi-directory namespace should be found." |
86 |
| - :class "MultiDirNs\\TheClass1" |
87 |
| - :file-name "src/MultiDirNs1/TheClass1.php" |
88 |
| - :project "with-composer") |
89 |
| - |
90 |
| -(define-class-definition-test ede-php-autoload-composer-find-multidir-2 () |
91 |
| - "The definition of the non-first item of a multi-directory namespace should be found." |
92 |
| - :class "MultiDirNs\\TheClass2" |
93 |
| - :file-name "src/MultiDirNs2/TheClass2.php" |
94 |
| - :project "with-composer") |
| 64 | +(define-class-definition-test ede-php-autoload-find-psr4-split-without-clash () |
| 65 | + "The definition of a class in a split namespace (iwht multiple sub-namespaces) should be found on PSR-4." |
| 66 | + :class "Psr4Split\\Ns2\\TheClass" |
| 67 | + :file-name "src/Psr4Split/Ns2/TheClass.php" |
| 68 | + :project "without-composer") |
95 | 69 |
|
96 |
| -(define-class-definition-test ede-php-autoload-composer-find-nothing () |
| 70 | +(define-class-definition-test ede-php-autoload-find-nothing () |
97 | 71 | "nil should be returned when no definition have been found."
|
98 | 72 | :class "Psr4Ns\\DoesNotExist"
|
99 | 73 | :file-name nil
|
100 |
| - :project "with-composer") |
101 |
| - |
102 |
| -(define-class-definition-test ede-php-autoload-composer-find-third-party () |
103 |
| - "The definition for a composer dependency's class should be found." |
104 |
| - :class "ThirdParty\\ThirdClass" |
105 |
| - :file-name "vendor/third-party/third-party/src/ThirdClass.php" |
106 |
| - :project "with-composer") |
107 |
| - |
108 |
| -(define-class-definition-test ede-php-autoload-composer-find-with-target-dir () |
109 |
| - "The definition for a composer dependency with a target dir should be found." |
110 |
| - :class "TargetDir\\Component\\TheClass" |
111 |
| - :file-name "vendor/target-dir/target-dir/TargetDir/Component/TheClass.php" |
112 |
| - :project "with-composer") |
| 74 | + :project "without-composer") |
113 | 75 |
|
114 | 76 | (provide 'ede-php-autoload-test)
|
115 | 77 |
|
|
0 commit comments